Hot answers tagged

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
  • 60.5k
26 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.7k
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,716
16 votes
Accepted

Replacing Skype, reinventing the chat client

In your chatGUI's __init__ your setting up some constants, that should really just be defined as constants at the class level: <...
SuperBiasedMan's user avatar
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
13 votes

Replacing Skype, reinventing the chat client

Don't use wildcard imports Instead of this: from tkinter import * Do this: import tkinter as tk With the latter, you then ...
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
  • 3,990
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
  • 21.9k
8 votes

Replacing Skype, reinventing the chat client

Apart from the issues pointed out by other people, there are numerous problems with the way you use TCP sockets. There are many intricacies to using raw sockets which you might not be aware of. TCP ...
Matti Virkkunen's user avatar
8 votes
Accepted

Python colour game

Now, I can't code in python or very well read it. But you have a bunch of comments, like these ...
Raystafarian's user avatar
  • 7,129
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
  • 60.5k
7 votes

Generating simple and complex passwords

I prefer import tkinter as tk and I can see that tk.Button, tk.INSERT, ...
furas's user avatar
  • 381
7 votes
Accepted

Calendar made with tkinter

From PEP8: Wildcard imports (from <module> import *) should be avoided, as they make it unclear which names are present in the namespace, confusing both ...
zondo's user avatar
  • 3,787
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,907
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
  • 9,955
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
  • 60.5k
6 votes

Python colour game

Text widget indexes e.delete(0, tkinter.END) The canonical first character of a text widget is the index "1.0", not the ...
Bryan Oakley's user avatar
  • 2,089
6 votes
Accepted

Simple word shuffling game

Bug You imported tkinter as a wildcard (*) so you should remove tkinter. from your program ...
Caridorc's user avatar
  • 27.5k
6 votes
Accepted

Simple word shuffling game - follow-up

This is not a good way to read in data. You have a .txt file purely just to read in a name. You're also reliant on data being in the right form. If someone tried to ...
SuperBiasedMan's user avatar
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.3k
5 votes

Simple word shuffling game - follow-up

I will try to give you as much feedback as I can, but I make no claim to be complete. General Add the encoding of your source code on top of your file. PEP263 recommends something like ...
AlexV's user avatar
  • 7,244
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
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
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

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

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