29
votes
Accepted
Python - Tkinter - periodic table of chemical elements
I hope you enjoy this bit of code.
I did!
Your symbols, keywords and values should have capitalised variable names since they're global constants. However, life would be easier if your symbols were ...
27
votes
Python - Tkinter - periodic table of chemical elements
Don't optimize the wrong thing
You have an excellent review already, so I'll comment on a narrow topic: cramped
code layout. For example:
...
18
votes
Accepted
System that manages employee data for managers
Welcome to Code Review! Kudos to writing a fairly large program.
Several things pop-out from your program. But, a few things first. If you are using any intelligent editor; please see if you can get ...
14
votes
System that manages employee data for managers
Don't do wildcard imports
Use import tkinter as tk and then prefix all tk classes and commands with tk. (eg: ...
12
votes
Accepted
Python Flashcards
First off, it's fantastic that you're grouping your widgets together when you create them, and then grouping your calls to grid together. Most people who are ...
10
votes
2048 game written in Python
Playability
For a game of 2048, I would expect that at least all of the tiles up to 2048 would have distinct colors.
The animation for each move is extremely annoying and confusing:
The sliding ...
10
votes
GUI for a quiz tool or game
1.
Instead of:
def __init__(self, root):
"""Constructor"""
self.root = root # root is a passed Tk object
do:
...
10
votes
A GUI Youtube Player (2)
Thanks for bravely offering up your code.
I'm sure it will emerge in better shape.
Each development project has its own standards.
If they aren't written down in the ReadMe,
then we tend to assume ...
8
votes
Accepted
Memory Game using Tkinter/Pygame
Most of your inline comments are useless
I see lots of comments like this:
def login_button(): # Defines login_button
That comment adds no information. It just ...
8
votes
Accepted
Digital clock with Python Tkinter
To start, it's crucial that you stop creating a brand new label ten times a second. Just modify the existing one. Also, this is so simple that a class is not called for. Move as much as possible away ...
7
votes
Minesweeper in Python Tkinter
A few superficial things:
Games like this are perfect for object oriented code. Some obvious classes for a Minesweeper game would include for example Game, ...
7
votes
Accepted
Python Sound visualizer
Nice.
Here are some observations:
consider using an IntEnum:
This helps remove "magic" numbers from the source code. (A year from now, will you remember that <...
7
votes
Accepted
Basic python GUI Calculator using tkinter
Separation of business from presentation
It's mostly good; Calculator is effectively your business layer. The one thing that creeps me out a little is using a ...
6
votes
Feynmann lifeguard riddle graphical representation
Don't use wildcard imports
Change from tkinter import * to import tkinter as tk, and then prefix all tk classes and variables ...
6
votes
Accepted
Arabic language lesson program
This got way out of hand for the comment section where it started, so let's make this an answer.
You want classes. That's good, since it's going to solve a lot of your repetition problems. Your code ...
Mast♦
- 13.5k
5
votes
Accepted
Displaying an arbitrary number of buttons and automatically arranging the buttons
Don't import tkinter twice
You're doing this:
import tkinter as tk
from tkinter import *
Remove the second import since you are already importing tkinter. That ...
5
votes
Accepted
Sudoku solver with Tkinter
I will be commenting on the first version, since it is the one using Tkinter as per the question title.
A few things on the GUI part for starter:
Since you only ...
5
votes
Python Stock Checker
Your code looks hard to read and not like Python code.
The main reason for this is that every second line is a comment. Most of these comments just repeat what the surrounding code does. These ...
5
votes
YouTube playlist steganography: hide secret messages inside YouTube playlists
Style
In any significant project, especially one that you are sharing through GitHub, it is important to write docstrings for each function. You haven't written any.
It is implied by the PEP 8 ...
5
votes
Accepted
Python Tkinter game, "Bubble, Blaster"
Don't use a wildcard import
Wildcard imports are discouraged by PEP8. Instead, I recommend doing imports like this:
import tkinter as tk
You will then have to ...
5
votes
Accepted
Python tkinter bouncing ball animation
Your animation isn't smooth because the ball is jumping 9 pixels for every frame. If you want smooth animation, change your "speed" to a much smaller number.
Animation is a set of trade-offs. The ...
5
votes
Feynmann lifeguard riddle graphical representation
Performance issue
The callback you are using for the b button forces your application to redraw the sea and sand rectangles as many times as the user clicks on ...
5
votes
Accepted
Python YouTube downloader with tkinter
Definitely have a look at the python logging page and the logging
cookbook for some simple patterns on building a logger.
Other thoughts are: class Log() doesn't do ...
5
votes
A game that is going somewhere
Don't use wildcard imports
You had this same advice on your prior post. You apparently decided to ignore it. It doesn't make you look smarter.
Use ...
5
votes
System that manages employee data for managers
In addition to the two previous answers, you should keep the initializer (__init__()) light and minimalist, and delegate most of the job to different functions ...
5
votes
Accepted
Python - Quiz Game with Tkinter
Use a single import
Instead of importing each individual class, I recommend importing the whole module with a short name. You can then use the short name as a prefix for all of your commands. It ...
5
votes
Python 3 simple Minesweeper game using tkinter
It's a good idea to use the Model–View–Controller pattern. But the implementation needs some work.
In MVC, the model should contain the complete description of the data being manipulated, together ...
5
votes
Accepted
Python beginner code for a currrency converter
pep-8
Try to follow the Python styleguide, and above all, be consistent. Now you use a mix between CamelCase, snake_case and <...
5
votes
Accepted
A little Python hex editor
Style
PEP8 is the de-facto standard style guide for Python and adhering to it will make your code look like Python code to others:
variable and method names should be ...
5
votes
Simple Python calculator applying MVC
Don't import tkinter twice.
You're importing tkinter twice:
import tkinter as tk
from tkinter import *
Just import it once, and prefix everything with ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
tkinter × 354python × 349
python-3.x × 138
gui × 67
beginner × 56
object-oriented × 35
game × 28
calculator × 19
python-2.x × 17
performance × 14
matplotlib × 10
youtube × 9
multithreading × 8
tic-tac-toe × 8
classes × 8
user-interface × 8
mvc × 7
animation × 7
sqlite × 7
canvas × 7
minesweeper × 7
tk × 6
image × 5
web-scraping × 5
quiz × 5