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,594 questions
6 votes
2 answers
276 views
LeetCode 2. Add Two Numbers
The task is taken from LeetCode. I would appreciate an assessment of whether my coding style follows good practices, and if there are any habits or patterns you would find concerning when working ...
9 votes
3 answers
547 views
Maze Solver in Python inspired by Micro-Mouse Competition Logic
Why I made it I watched this video by veritasium about Micro-Mouse maze-solving competitions, and found the logic to get to the center fascinating. Hence, despite not having a maze or a mouse, I spent ...
5 votes
5 answers
966 views
Function in Python that encrypts and decrypts, taking string to list and the other way around
I'm new on Python, so I'm looking at these YouTube videos of Python projects to practice, and I saw this one of a Password Manager with encryption, but the encryption part couldn't use password, ...
5 votes
4 answers
407 views
Absolute-path Python function taking as argument a path relative to the directory of a script (.py) or Jupyter notebook (.ipynb) file
I'm currently still in the early stages of learning Python and Jupyter notebooks, and I wanted to ask if the following code for returning absolute paths relative to the directory of a script (...
5 votes
3 answers
546 views
Ping sweep of IP subnets
I made a ping sweep for the first time, and I want to do better. What do you think that I might be missing? ...
9 votes
2 answers
612 views
Find the nearest school to you
I have created a text-based program that finds the nearest school using your coordinates. The CSV DataFrame is available through LimeWire. I'd like to know how I can improve it. ...
5 votes
2 answers
238 views
Transform dataset coordinates from Lambert Conformal Conic projection to WGS84
I am trying to convert a dataset which has a Lambert Conformal Conic projection to the classic WGS 84 with Python. Unfortunately, the dataset does not have a defined EPSG code, but the general ...
5 votes
3 answers
600 views
News API in Python - Take II
From my previous post, I tried to take into account all of the nice answers made by Kate, Chris, J_H, Booboo and mudskipper Changes made In short, I attempted to apply all of the following: API key ...
8 votes
5 answers
1k views
News API in Python
Why I made it I’m building a voice assistant and thought it would be great if it could deliver news updates. What it does It cleans up the user’s query, determines whether it refers to a news category ...
4 votes
2 answers
276 views
Create Frame Widget with Pygame
I developed two custom UI components with Pygame: a Button widget and a Frame widget. After placing the Button inside the Frame, I encountered an issue with the Button’s collision detection. ...
5 votes
4 answers
491 views
Substitute patterns with values from lists
I was looking at a Stack Overflow question and got somewhat carried away with improving the solution, well beyond the scope of that question. In summary, we have a string such as ...
6 votes
3 answers
657 views
ASCII-based Lightweight Browser with Clippy-Style Helper in Python (Updated)
This question used to contain a mistake in the code, so I had to debug and reformat it. This is the correct version. Why I made it A friend and I wanted to make a lightweight browser, since our ...
1 vote
2 answers
129 views
ASCII-based Lightweight Browser with Clippy-Style Helper in Python [duplicate]
Note that this is the original version which has not been formatted to comply to PEP-8 and contains an error in the code. Please visit the updated version instead to post answers, comments and/or cast ...
7 votes
3 answers
826 views
Optimizing real-time ASCII playback in Python when each frame is fetched as a PNG via GET
Why I made it I wrote this script for one simple purpose: to Rickroll my friends. How it works This is the workflow: It fetches a .png frame from a PHP endpoint on a website I own. The frame number ...
4 votes
2 answers
697 views
Unicode-based platformer game in Python (Updated)
I already asked this question, but the script I provided was not compliant to PEP-8, so I rewrote the script for better readability. I'm making a platformer game called Uni where this small character ...