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,643 questions
6
votes
4
answers
65
views
Convert OpenAPI Response Schema to PySpark DataFrame Schema
Introduction
I have created a small script designed to do the following:
Download/read an OpenAPI json document
Given a specific endpoint, convert the ...
3
votes
2
answers
104
views
War of dots (client): A simple RTS war game in python
Follow up question for War of dots: simple RTS war game in python. Code here, extra stuff here (screenshots, profiles, documentation). Server is being reviewed here.
What's changed?
Since last code ...
4
votes
2
answers
738
views
War of dots (server): A simple RTS war game in python
Follow up question for War of dots: simple RTS war game in python. Code here, extra stuff here (screenshots, profiles, documentation). Client is being reviewed here.
What's changed?
Since last code ...
5
votes
1
answer
170
views
Romberg integration using integer arithmetic - without using Romberg's method
This is related to my previous question.
This is what I have been working on in the past month.
The title says it all, I have implemented numerical integration using integer arithmetic and Romberg ...
-2
votes
1
answer
67
views
5
votes
3
answers
668
views
English and Roman numeral converter in Python
I wrote this program over half a year ago, but I decided to not share it because the task seems trivial to me. Today I decided to post it here. As it is designed to work with strings and messiness of ...
6
votes
4
answers
552
views
Numerical integration via Newton-Cotes formulas using integer arithmetic
I have written a Numerical integration library in Python from scratch using Newton-Cotes formulas and integer arithmetic, as a self-imposed programming challenge. I wrote all the code completely by ...
7
votes
4
answers
1k
views
Python fraction class
I have been using basic algebra to calculate many things using only integer arithmetic by separating the parts. Like \$(a + b \sqrt{N})(c + d \sqrt{N}) = (ac + Nbd) + (ad + bc)\sqrt{N}\$, and \$(a + ...
7
votes
3
answers
393
views
Video Temporal Segmentation for Vision Language Model Processing
Recently, I am playing with Vision Language Models, including cosmos-reason2. The provided example "inference_sample.py" loads trained vision language model and a video directly, then ...
5
votes
3
answers
876
views
Line of Sight function for a hex-based wargame
I have a hex-based wargame (Battle of Chickamauga, based on the GBACW rules) in Python (using Pygame), where a small portion of the hex-grid looks like this:
Different background colors represent ...
9
votes
2
answers
453
views
A Python generator for reduced fractions in the interval [0, 1] with 1/D spacing
The problem I was trying to solve is simple, given an integer, find all fractions with the denominator being the input and numerator in range(0, denominator+1) and ...
8
votes
3
answers
1k
views
Time travel game
Basically I am working on a time travel game, and every time you run the game, you play with one more 'past you'. Hold right click to move in mouse direction, left click to "shoot" (just ...
5
votes
5
answers
808
views
YouTube Downloader implementation using CustomTkinter and Pytubefix
I am a first-year software engineering student. I have developed my first Python application called NshDownload, and I would appreciate your feedback on the code quality and structure.
Project ...
10
votes
6
answers
1k
views
Formatting dates to YYYY/MM/DD
The 'CS50 Introduction to Programming with Python' course allows you to check that your code can pass various tests before submitting your work, providing a green smiley face for each pass.
Currently, ...
8
votes
5
answers
1k
views
War of dots: simple RTS war game in python
DISCLAIMER: All credit goes to the original War of dots.
Github link
Has profiles, executables (a pre release) and more screenshots.
Backstory:
I used to play risk when I was a kid, but I always had ...