Skip to main content
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 ...
Reinderien's user avatar
  • 62.8k
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: ...
FMc's user avatar
  • 12.8k
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 ...
hjpotter92's user avatar
  • 8,726
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: ...
Bryan Oakley's user avatar
  • 2,089
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 ...
Bryan Oakley's user avatar
  • 2,089
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 ...
200_success's user avatar
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: ...
Samwise's user avatar
  • 4,000
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 ...
J_H's user avatar
  • 30.8k
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 ...
Bryan Oakley's user avatar
  • 2,089
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 ...
Reinderien's user avatar
  • 62.8k
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, ...
l0b0's user avatar
  • 8,917
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 <...
RootTwo's user avatar
  • 10k
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 ...
Reinderien's user avatar
  • 62.8k
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 ...
Bryan Oakley's user avatar
  • 2,089
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's user avatar
  • 13.4k
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 ...
301_Moved_Permanently's user avatar
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 ...
Bryan Oakley's user avatar
  • 2,089
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 ...
Roland Illig's user avatar
  • 21.3k
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 ...
200_success's user avatar
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 ...
Bryan Oakley's user avatar
  • 2,089
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 ...
Bryan Oakley's user avatar
  • 2,089
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 ...
Billal Begueradj's user avatar
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 ...
C. Harley's user avatar
  • 1,523
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 ...
aghast's user avatar
  • 12.4k
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 ...
Billal Begueradj's user avatar
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 ...
Bryan Oakley's user avatar
  • 2,089
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 ...
Gareth Rees's user avatar
  • 49.6k
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 <...
Maarten Fabré's user avatar
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 ...
301_Moved_Permanently's user avatar
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 ...
Bryan Oakley's user avatar
  • 2,089

Only top scored, non community-wiki answers of a minimum length are eligible