Skip to main content

New answers tagged

1 vote

Python 3 tkinter calculator

It's a small note, but let's take this: self.number_buttons = [] And this: ...
Chris's user avatar
  • 4,684
1 vote

Python 3 tkinter calculator

Portability I get syntax errors due to illegal indentation: def bind_keys(self): """ Binds events to keyboard button presses. """ The ...
toolic's user avatar
  • 15.8k
3 votes

Catch the turtle - Python

Overall, this looks good! Here are my suggestions, which are a bit more specific to the turtle library than the existing review: Use onkeypress rather than ...
ggorlen's user avatar
  • 4,197
0 votes

Calculate the median value of combining two sorted lists

Let's break the merging of two lists out into a function. And for fun, let's have the function return an iterator rather than eagerly working on both lists. ...
Chris's user avatar
  • 4,684
0 votes

Python project to scrape webpages and build text datasets for ML purposes

Returning None If we look at download_text there is an opportunity. ...
Chris's user avatar
  • 4,684
8 votes

Python project to scrape webpages and build text datasets for ML purposes

comments Lines of code: ~200 I'm sure that was true when you wrote it. Looks like you've added a hundred or so lines since then. Comments tend to bit rot as the codebase evolves, which is why we ...
J_H's user avatar
  • 42.3k
4 votes

Python project to scrape webpages and build text datasets for ML purposes

Overview The code layout is good, and you added ample documentation with usage examples. try/except In the download_text function, the ...
toolic's user avatar
  • 15.8k
7 votes

Python project to scrape webpages and build text datasets for ML purposes

You have docstrings and comments that are very useful. Your code also seems to be very well organized and structured. The API is simple enough. My only questions/suggestions are: Security Concerns You ...
Booboo's user avatar
  • 3,666
5 votes

Moving ball simulation within a donut

resolve_collisions() tests the separation of every pair of balls, so its complexity scales as O(n²). Consider dividing the box into sub-areas, so we only have to ...
Toby Speight's user avatar
  • 88.3k
2 votes

Moving ball simulation within a donut

More Descriptive/Accurate Docstrings Since you have chosen to use docstrings instead of type hints, then try to be more precise is describing what the arguments to the functions are. For example, I ...
Booboo's user avatar
  • 3,666
2 votes

Moving ball simulation within a donut

I don't have any advice about performance, but here are some general coding style suggestions. DRY This expression is used several times: box_size/2 You can set it ...
toolic's user avatar
  • 15.8k
1 vote

Solve a system of linear equations with Gauss algorithm

I somewhat doubt that the original poster is still around, but for posterity: 700 lines is too long for such a program. It's too hard-coded (a, b, ...), and not flexible enough - it only supports up ...
Reinderien's user avatar
  • 71.1k
2 votes

Solve a system of linear equations with Gauss algorithm

Not only are names like a1 and b2 non-descriptive, but they all of these objects should probably be in lists or dictionaries ...
Chris's user avatar
  • 4,684
2 votes

Solve a system of linear equations with Gauss algorithm

UX When I run the code, the GUI title has the acronym "LGS". It would be helpful to spell out the acronym somewhere in the window. Also, I do not know what I should enter into each field. ...
toolic's user avatar
  • 15.8k
0 votes

A tabbed calculator with tkinter

Portability I get a syntax error when I run the code: NameError: name 'my_subtraction' is not defined In all_tabs.py, this line ...
toolic's user avatar
  • 15.8k
3 votes

Calculation of liquid propellant nozzles

I don't really understand any of this, so I can only speak as a programmer, but the code looks good and fairly well structured. Naming conventions make sense in plain English even to an outsider. If ...
Kate's user avatar
  • 8,313
2 votes
Accepted

Calculation of liquid propellant nozzles

Overview The code layout is good, and you used meaningful names for classes, functions and variables. It seems like the code is already structured for future enhancements. Long lines There are a ...
toolic's user avatar
  • 15.8k
2 votes

Timer with input, sound and flashing

Portability When I copy the code out of the question and try to run it, I get syntax errors due to indentation. Perhaps your indentation mixes single spaces with tab characters on the same line, and ...
toolic's user avatar
  • 15.8k
1 vote

Calculation of Correlation Time

Here are some general coding style suggestions. Unused code This variable is set but never used: start_time = time.time() It can be deleted, which means this line ...
toolic's user avatar
  • 15.8k
1 vote

Web scraping data from website using Selenium

Portability When I run the code, I get a syntax error on lines like this: ...
toolic's user avatar
  • 15.8k
1 vote

Snake game in pygame with varying velocity

Imports The import lines should precede all executable code; move the init call: ...
toolic's user avatar
  • 15.8k

Top 50 recent answers are included