/r/pythoncoding
/r/Pythoncoding is a subreddit for advanced Python content. Developers can share articles and news about the Python ecosystem, deep dives into Python intricacies, or showcase advanced projects they are working on.
This sub is currently being cleaned up. Please help by reporting unsuitable content!
/r/PythonCoding a subreddit for advanced Python content. Python developers can share articles and discuss things relevant to the Python programming language, while avoiding chaff like tutorials, courses, books, and blog spam.
In turn, this subreddit has a strict moderation policy for submissions.
For general or beginner content, see /r/Python or /r/LearnPython instead.
If you have an issue with the moderation policy, please send us a message
Don't post:
Full rules: Here
Other Python subreddits:
/r/django
/r/learnpython
/r/madeinpython
/r/python
/r/pythontips
Other related subreddits:
/r/pythoncoding
Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!
If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.
Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!
If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.
Whenever I'm researching or studying anything, I tend to save a ton of content. It could be a cool article link, a fact someone mentioned in my chats or a blog post about it. But organizing all this content and then effectively researching or learning from it is a difficult task. That’s where SurfSense comes in. SurfSense acts like a personal brain for any content you consume, allowing you to easily revisit, organize, and effectively research and learn from your saved content.
Check it out at https://github.com/MODSetter/SurfSense
Well my project have 3 things where extension and frontend is made in JS but core backend is made in python with LangChain and FastAPI.
If any good python devs could go through my backend and suggest some tips to improve it would be great.
And if u know any good resources about WebSockets implementation with FastAPI do mention in comments.
Researchers, Students or Anyone who consume a lot of content
We’re excited to announce Maelstrom 0.12.0, a test runner for Python that can run tests locally or on a cluster. Our new UI features real-time information about running tests, output from the build, and a new progress bar.
Maelstrom is a suite of test runners, built on top of a general-purpose clustered job engine. Maelstrom packages your tests into micro-containers, then distributes them to be run on an arbitrarily large cluster of test-runners, or locally on your machine using a custom-built, super-fast container runtime.
Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!
If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.
Hey everyone! I am Dinones! I coded a Python program using object detection that lets my computer hunt for shiny Pokémon on my physical Nintendo Switch while I sleep. So far, I’ve automatically caught shiny Pokémon like Giratina, Dialga or Azelf, Rotom, Drifloon, all three starters, and more in Pokémon BDSP. Curious to see how it works? Check it out! The program is available for everyone! Obviously, for free; I'm just a student who likes to program this stuff in his free time :)
The games run on a Nintendo Switch (not emulated, a real one). The program gets the output images using a capture card, then, it process them to detect whether the pokemon is shiny or not (OpenCV). Finally, it emulates the joycons using bluetooth (NXBT) and control the Nintendo. Also works on a Raspberry Pi!
I don't make money with this, I just feel my project can be interesting for lot of people.
📽️ Youtube: https://www.youtube.com/watch?v=84czUOAvNyk
🤖 Github: https://github.com/Dinones/Nintendo-Switch-Pokemon-Shiny-Hunter
Well when I’m browsing the internet, I tend to save a ton of content—but remembering when and what you saved? Total brain freeze! ❄️ That’s where SurfSense comes in. SurfSense is like a Knowledge Graph 🧠 Brain 🧠 for anything you see on the World Wide Web. Now, you’ll never forget any browsing session. Easily capture your web browsing session and desired webpage content using an easy-to-use Chrome extension. Then, ask your personal knowledge base anything about your saved content., and voilà—instant recall! 🧑💻🌐
The whole backend is made in FastAPI & Langchain in Python.
Do give it a try : https://github.com/MODSetter/SurfSense
and lmk what is your feedback/suggestions.
I have been coding for a long time in Python, but I recently started college to get my bachelor's. My teacher made these comments, and I am not sure how to improve. While I did not get a bad grade, he deducted points, and dont want to make the same mistake.
Cmmments from my teacher:
Your code is clear and easy to understand—great job!
Questions:
How can I add more indentations with Python, as it needs to be indented in a certain way?
What comments can I make about the code, specifically the "complex " parts, as this is a basic example and not complex?
My code:
class BudgetCalculator:
def __init__(self):
self.monthly_income = 0
self.fixed_expenses = 0
self.variable_expenses = []
def gather_user_data(self):
try:
self.monthly_income = float(input("Enter your monthly income: "))
self.fixed_expenses = float(input("Enter your fixed monthly expenses (e.g., rent, utilities): "))
while True:
var_expense = input("Enter a variable expense (or type 'done' to finish): ")
if var_expense.lower() == 'done':
break
expense = float(var_expense)
if expense < 0:
print("Expense cannot be negative, please re-enter.")
else:
self.variable_expenses.append(expense)
except ValueError:
print("Invalid input. Please enter numeric values.")
def calculate_total_variable_expenses(self):
return sum(self.variable_expenses)
def calculate_remaining_budget(self):
total_variable_expenses = self.calculate_total_variable_expenses()
if self.fixed_expenses < 0 or total_variable_expenses < 0:
raise ValueError("Expenses cannot be negative.")
if self.monthly_income < (self.fixed_expenses + total_variable_expenses):
raise ValueError("Expenses exceed income.")
remaining_budget = self.monthly_income - (self.fixed_expenses + total_variable_expenses)
return remaining_budget
def display_result(self):
try:
remaining_budget = self.calculate_remaining_budget()
print(f"Your remaining budget for the month is: ${remaining_budget:.2f}")
except ValueError as e:
print(e)
def main():
budget_calculator = BudgetCalculator()
budget_calculator.gather_user_data()
budget_calculator.display_result()
if __name__ == "__main__":
main()
Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!
If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.
You can find it at Stava.io, looking forward to the feedback! :)
I have read about the Global Interpreter Lock (GIL) and understand that it is a lock per interpreter in Python, which is historical. However, I still see thread packages in Python. Why are they there if the GIL exists? What's the point?
So, what is the verdict here?
Thanks
I have a Shelly blu door and window sensor connected through a Shelly plus 2 PM. I’m trying to find a way to get the status open/closed using python or home assistant.
I completed my first python project which allow people to download manga from terminal using manga dex API this was my project with API
https://github.com/I3WX/manga-downloader.git
if you experienced program can look at the code and point out mistakes and give me suggest how to improve it
and any manga reader if you use it Plz I will love to get you feedback
Hey folks, we’ve just launched an open-source library called Django AI Assistant, and we’d love your feedback!
What It Does:
How You Can Help:
Your input will help us make this lib better for everyone. Thanks!
Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!
If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.
You can directly edit the example in this sandbox:
https://py.cafe/kolibril13/networkX-threejs
Next to the editor, there's also a terminal log and an interactive viewport with a threejs visualization.
Note that this all runs with Pyodide, so all Python code will be executed locally in the browser on your machine.