Questions tagged [python]
Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability. Use the python tag for all Python related questions. If you believe your question may be even more specific, you can include a version specific tag such as python-3.x.
15,766 questions
Score of 5
3 answers
432 views
Job scraping (Playwright) and batch classification via Gemini API
I have just written my first practical Python script, and I would highly appreciate it if you could review it and give me some advice on how to make it more Pythonic and efficient.
Project Overview
...
Score of 6
4 answers
382 views
Python index sieve for cuban primes (3n² + 3n + 1)
This is a deterministic index sieve for numbers of the form H(n) = 3n² + 3n + 1 (cuban primes). It uses no probabilistic tests (no Miller-Rabin), only pure Python standard library.
Benchmark on iPhone ...
Score of 3
3 answers
243 views
Improved my Diffusion limited aggregation simulation code
Last week I posted a code and asked for improvement advices and I got a lot of answers, but the one came back mostly was readability, and hence I improved the code layout:
...
Score of 7
7 answers
413 views
Diffusion limited aggregation Python Script
Around May and June 2026, I did an internship (it was my second year physics undergraduate) at a laboratory associated with my university. I was being supervised by a teacher of mine. At that time I ...
Score of 5
4 answers
378 views
Optimizing an alternating triplet partition algorithm in Python using Dynamic Programming
I have developed a partitioning heuristic designed to balance a collection of 3N positive integer weights into two sets of equal sum. The approach splits the task into a deterministic pre-sorting ...
Score of 2
2 answers
97 views
Refactoring duplicate positive amount validation across invoice and pricing modules
I have a Python billing package where two separate modules (invoice.py and pricing.py) implement the exact same validation logic ...
Score of 6
2 answers
326 views
Timeit for Code with In-Place Modification
Motivation
I use timing and profiling tools often, but sometimes I want to time code which will modify values in-place. This is a notable shortcoming of the builtin ...
Score of 4
4 answers
516 views
Traffic data analysis study project with Pandas and numpy
I am a traffic engineering student studying Python for data science and was able to get some real raw traffic counters output from my teacher for excercise.
Would love to get some feedback, since I am ...
Score of 3
5 answers
271 views
Menu screen with multiple different functions
My code is based on trying to make a working menu screen with multiple different functions. I have been trying to learn on and off for a couple of years. I mostly use a lot of definitions in my code ...
Score of 1
1 answer
311 views
Selection sort in Python
Just a simple selection sort this time.
Code
...
Score of 5
4 answers
431 views
Data Engineering Assignment (learning to make Data Pipeline)
I am doing an internship, and my senior gave me this assignment that I build a pipeline that will get data from an API and then insert into a database, and it should handle all possible errors and it ...
Score of 5
3 answers
939 views
Terminal-based text RPG in Python
I'm an intermediate-beginner Python programmer with backend development as my end goal. This is a personal project — a terminal-based RPG — that I'm using to practice functions, dictionaries, loops, ...
Score of 2
3 answers
157 views
Train ResNet18 CNN model for automatic fishing in Minecraft
This model classifies the state of the float in the area in the center of the screen.
Input images have a resolution of 256x256.
I would like a general code review.
...
Score of 0
2 answers
110 views
Speeding up computation of binomials in Python
Intro
This post is a rewrite of Speeding up computation of binomials with Java's BigIntegers.
Code
binomial.py:
...
Score of 4
2 answers
504 views
Chess game In Python using Qt
I made a Chess game in Python using PySide6 (Python Bindings for Qt). I would appreciate any comments and feedbacks.
I have implemented all of the Chess move that I know, including the special moves ...