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
  • 71.2k
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
  • 13.1k
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 a ...
hjpotter92's user avatar
  • 8,941
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,169
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,169
11 votes
Accepted

Yet Another Python Weather Visualizer using Open-Meteo

Good PEP 8 Conformance You have conformed to the PEP 8 style guide reasonably well. For example: import statements are in the correct order. You have provided type ...
Booboo's user avatar
  • 4,101
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,010
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
  • 43.3k
9 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
  • 10.7k
8 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 ...
C. Harley's user avatar
  • 1,663
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,169
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
  • 71.2k
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
  • 9,117
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
  • 71.2k
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,169
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.9k
6 votes
Accepted

Calculator in Python 3 using Tkinter

Disclaimer: you should not be using eval that said I am not going to be removing it from the code as you can work out the correct options on your own. I will be ...
Mike - SMT's user avatar
6 votes

Simple calculator in python using tkinter

DRY - don't repeat yourself All the button_X functions can be replaced by a single parametrized button(digit: int) function: <...
QuasiStellar's user avatar
  • 2,327
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.6k
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,169
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,169
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
  • 50.1k
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,169
5 votes
Accepted

Python 3 calculator with tkinter

When I was learning Python, I found The Zen of Python quite helpful. Formatting I agree about renaming self.e to self.textbox. ...
TheGreatGeek's user avatar

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