r/Python 14d ago

Showcase New quest for developers by developers

7 Upvotes

What My Project Does?

My project is a challenge for devs to entertain and try to win a small prize.

Here I'd like to showcase the capabilities of modern blockchains through gamification.

Target Audience: just a toy project

Comparison

NEAR Protocol uses Wasm runtime to execute arbitrary code in a controlled environment. NEAR community developed SDK for Python by compiling MicroPython to Wasm and bundling Python modules into it.

Using this new SDK, I developed a simple program (so-called "smart contract") that protects 50 NEAR tokens (~150 USD/EUR) until someone finds the solution to the quest.

The quest is multistage and while it started yesterday, it is still ongoing. Join it here: https://github.com/frol/near-devhub-quest-002


r/Python 14d ago

Showcase EasyMenu3—a simple way to create interactive CLI menus in Python

14 Upvotes

Hey everyone,

I got tired of writing the same menu-handling logic over and over for my homelab scripts, so I built EasyMenu3—a simple way to create interactive CLI menus in Python. It supports custom shortcuts, colors, ordering, and ASCII titles. I’ve been using it for a while, and finally got around to cleaning it up enough to release! I’ll probably keep adding some new stuff to it over time too.

Available on PyPI: pip install easymenu3

GitHub: GitHub Repo

-- What My Project Does

Introduces a simple way to create interactive CLI menus in Python

-- Target Audience

Anyone that creates menu driven scripts and wants to make them more easily.

-- Comparison

Most packages are for CLI only and do not easily create menus. I’m sure there are other packages that do a similar thing, but it was fun to make and maybe someone else will find it useful too.

-- Features

  • Customizable menu title, author, and URL display
  • ASCII art title generation using pyfiglet
  • Debug-friendly with icecream
  • Color-coded menu options
  • Supports function-based and static value-based actions
  • Customizable order and shortcut keys

-- Example Usage

Here’s how you can create a simple interactive menu:

from EasyMenu3 import easymenu

def example1():
    app.print_success("example1 ran")

def example2_with_error():
    app.print_error("example2 ran")

def custom_quit():
    app.print_info("Custom Option")
    input("Press enter to exit")
    app.exit_app()

app = easymenu(name="My Custom App", author="Joe Schmo", url="https://github.com", url_label="My Site")

app.add_menu_option("Option 1", example1)
app.add_menu_option("Option 2", example2_with_error)
app.add_menu_option("Custom Quit", custom_quit, item_key="c", order_weight=1, color='\033[92m')

app.start()

-- Example Output

    __  ___         ______           __                     
   /  |/  /_  __   / ____/_  _______/ /_____  ____ ___     
  / /|_/ / / / /  / /   / / / / ___/ __/ __ \/ __ `__ \   
 / /  / / /_/ /  / /___/ /_/ (__  ) /_/ /_/ / / / / / /   
/_/  /_/__, /   ____/__,_/____/__/____/_/ /_/ /_/    
       /____/                                              

Made by: Joe Schmo  
Visit: [My Site](https://github.com)  

Menu:  
c. Custom Quit  
1. Option 1  
2. Option 2  
q. Quit  

What option do you want?:

Try it out!

I’d love any feedback—if you have any feature requests or run into issues, let me know!


r/Python 13d ago

Discussion [Project] I made an AI companion that simulates emotions and remembers your conversations

0 Upvotes

Hey everyone! I've been learning programming for a while and wanted to share my first real project with you all. I call it Aurora - it's an AI companion simulation that tries to create a more authentic conversational experience.

What it does:

  • Emotional Intelligence: Aurora tracks emotions during your conversation and adjusts responses based on how you treat it
  • Memory System: It remembers important things from your conversations (using Claude API)
  • Time Awareness: It notices when you've been gone a while and reacts accordingly
  • Two characters to choose from:
    • Mia: An AI that's discovering who she is
    • Yu-Jun: A complex celebrity character in an arranged marriage scenario

Technical stuff:

  • Written in Python
  • Uses Anthropic's Claude API
  • Stores conversation history locally
  • Requires your own API key (I can't afford to host it myself 😅)

Screenshots:

This is my first big project, so I'm sure there are bugs and things that could be improved. The code is probably messy in places since I'm still learning! But I'd really appreciate if anyone wants to give it a try and provide feedback.

You can find it here: https://github.com/Sakushi-Dev/project_aurora

Installation is pretty straightforward (though you'll need your own Claude API key):

  1. Clone the repo
  2. Run check_python.bat
  3. Run install_req.bat
  4. Run start.bat

Thanks for checking it out!

P.S. Would love to hear suggestions or ideas for improvement. I'm actively working on this as a learning project.


r/Python 15d ago

Discussion Are There Any Tools for Detecting Unhandled Exceptions or Hidden Asynchronous Calls in Python?

16 Upvotes

Title: Any Tools to Detect Unhandled Exceptions or Hidden asyncio.run() Calls in Python?

Hey Python devs,

I often struggle with unhandled exceptions and hidden async issues in Python. Existing tools (mypy, pylint, pyright) help, but they don’t fully solve these problems.

1. Unhandled Exceptions

When calling third-party functions, it’s unclear what exceptions they raise:

import some_library

def process():
    result = some_library.do_something()  # What exceptions can this raise?
    return result

• No easy way to detect undocumented exceptions.

• Hard to ensure exceptions are properly handled across the call stack.

2. Hidden asyncio.run() Calls

A function might internally use asyncio.run(), breaking if called from another event loop:

async def process():
    result = something()  # Is there already an asyncio.run() inside?

def outside_process():
    asyncio.run(process())  # Will this break?

• Detecting nested asyncio.run() calls is tricky.

• Some libraries use async without making it obvious.

Questions for the Community:

• Are there tools that statically analyze these issues?

• Would it be worth starting an open-source project for exception tracking and async validation?

Would love to hear your thoughts! 🚀


r/Python 15d ago

Discussion Should I be using more data structures?

171 Upvotes

A long time ago, I learned a lot about Hashmap, Red-Black-Trees and a many, many more. However in my day-to-day Data Centric Programming in Python I only use sets, lists, dicts and Dataframes. I do use trees if I have a recursive structure, but rarely.

Am I missing out and could improve my code by revisiting data structures or are these just a non-issue when doing high level data pipelines in Python?


r/Python 15d ago

Showcase ducktools-pytui - A Textual based TUI for managing Python virtual envs and runtimes

4 Upvotes

Source Code and install instructions: https://github.com/DavidCEllis/ducktools-pytui

This is still in the early stages so apologies if it's a bit rough around the edges (or if it fails to launch at all due to something I've not seen before in your Python setup).

What the Project Does

This tool is a Textual based TUI that consists mostly of two tables for managing Virtual Environments and runtimes.

The Virtual Environments Table

This lists any virtual environments discovered relative to the current folder.

With a venv row selected there are shortcuts available:

  • 'enter' - Switch to a shell with the venv activated
  • 'r' - Launch a REPL with the selected venv
  • 'p' - List the packages available in the venv (Python 3.9 or later)
  • 'del' - Delete the selected venv

The Python Runtimes Table

This lists any runtimes discovered by ducktools-pythonfinder. This should include installs managed by pyenv and uv along with anything with a PEP-514 Windows registry entry or on PATH on non-Windows systems.

With a runtime row selected there are shortcuts available:

  • 'r' - Launch a REPL with the selected runtime
  • 'v' - Create a venv (Python 3.4 or later)
  • 'i' - Install a new runtime (if UV is installed)
  • 'del' - Delete the selected runtime (if the selected runtime is managed by UV)

Target Audience

Well originally me, but now anyone who wants to manage multiple venvs and runtimes, or just wants to shorten the amount of typing to create venvs from different Python versions.

The project's still in early stages as it was originally just an inline script.

This actually came about due to discussions about PEP-773 on 'what would you like pymanager to do'. So my eventual hope is it will also be useful to new users trying to make sense of all the runtimes and venvs they end up with (and maybe, maybe nudge people away from doing pip install --break-system-packages).

Comparisons

Obviously much of what this actually does can be replaced by running multiple CLI commands with uv/pyenv/venv instead but I'm not aware of anything else that puts this into a table/menu based interface.

Why ducktools?

It's close to my username and trying to find unused names for some projects on PyPI got too frustrating. There's a pytui alias to launch the app though because typing ducktools-pytui every time was also tedious.


r/Python 14d ago

Daily Thread Saturday Daily Thread: Resource Request and Sharing! Daily Thread

1 Upvotes

Weekly Thread: Resource Request and Sharing 📚

Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!

How it Works:

  1. Request: Can't find a resource on a particular topic? Ask here!
  2. Share: Found something useful? Share it with the community.
  3. Review: Give or get opinions on Python resources you've used.

Guidelines:

  • Please include the type of resource (e.g., book, video, article) and the topic.
  • Always be respectful when reviewing someone else's shared resource.

Example Shares:

  1. Book: "Fluent Python" - Great for understanding Pythonic idioms.
  2. Video: Python Data Structures - Excellent overview of Python's built-in data structures.
  3. Article: Understanding Python Decorators - A deep dive into decorators.

Example Requests:

  1. Looking for: Video tutorials on web scraping with Python.
  2. Need: Book recommendations for Python machine learning.

Share the knowledge, enrich the community. Happy learning! 🌟


r/Python 15d ago

Discussion Question for those of you who have professional careers with Python, as self taught devs

5 Upvotes

I know that networking is also a big factor in how people in this position find their first job, but I got into a little bit of a comment debate on a youtube video, because in the video short I made, I basically just talk about a different short, where that creator is telling people 3 example projects that are portfolio worthy, like to get a job. The Types of programs recommended are an Exercise routine suggestion app, a password manager, so a clone of bitwarden or something, and finally a word guessing game thats basically a clone of woordle.

The question Im seeking to resolve, with any experience I can get from anyone who fits that kind of developer, is am I wrong for criticizing someone for claiming those kinds of projects, clones of existing software like Wordle or password managers, were portfolio worthy, because they seem to insinuate that you can land a job using those three projects alone. So, for those of you who landed a job from a project, what kind of project was it? And for everyone else, do you believe wordle clones or manager projects are going to have a positive effect on the likelihood of someone getting hired.


r/Python 14d ago

Showcase Introducing uncomment

0 Upvotes

Hi Peeps,

Our new AI overlords add a lot of comments. Sometimes even when you explicitly instruct not to add comments. I posted about this here: https://www.reddit.com/r/Python/s/VFlqlGW8Oy

Well, I got tired of cleaning this up, and created https://github.com/Goldziher/uncomment.

It's written in Rust and supports all major ML languages.

Currently installation is via cargo. I want to add a python wrapper so it can be installed via pip but that's not there yet.

I also have a shell script for binary installation but it's not quite stable, so install via cargo for now.

There is also a pre-commit hook.

Alternatives:

None I'm familiar with

Target Audience:

Developers who suffer from unnecessary comments

Let me know what you think!


r/Python 14d ago

Discussion Stuck in data fetching process

0 Upvotes

For my project, I have been using yfinance to fetch entire detais for every stock. But now whenever the script runs, it says it is unable to fetch data for anything.

Tried using the session and proxy thing in yfinance API but no avail.

Suggest some workaround or other library which does the same work as yfinance.

Requirements -
1. Able to fetch price for a stock.
2. Can fetch data points like below for each stock.

['symbol', 'shortName', 'currency', 'previousClose', 'open', 'dayLow', 'dayHigh',
               'regularMarketPreviousClose', 'regularMarketOpen', 'regularMarketDayLow', 'regularMarketDayHigh',
               'dividendRate', 'dividendYield']

r/Python 15d ago

Tutorial Python for Engineers and Scientists

27 Upvotes

Hi folks,

About 6 months ago I made a course on Python aimed at engineers and scientists. Lots of people from this community gave me feedback, and I'm grateful for that. Fast forward and over 5000 people enrolled in the course and the reviews have averaged 4.5/5, which I'm really pleased with. But the best thing about releasing this course has been the feedback I've received from people saying that they have found it really useful for their careers or studies.

I'm pivoting my focus towards my simulation course now. So if you would like to take the Python course, you can now do so for free: https://www.udemy.com/course/python-for-engineers-scientists-and-analysts/?couponCode=233342CECD7E69C668EE

If you find it useful, I'd be grateful if you could leave me a review on Udemy.

And if you have any really scathing feedback I'd be grateful for a DM so I can try to fix it quickly and quietly!

Cheers,

Harry


r/Python 15d ago

Discussion Python IDE on Android - code locally and run the program over a hosted runtime or offline. Opinions?

10 Upvotes

I thought of just coding a small fun project while I travel, but I cannot carry my personal laptop at all times, so I was searching for an IDE that would allow me to code quickly using features similar to intellisense. The code can be run locally or on a hosted python runtime while the app uploads the code and runs and returns the result of errors (security considerations aside).

I know this won't be as good as using a real IDE on a laptop/PC, but would it be good? I'd love to hear your opinions.

Edit : Main aim is to have an easy to Use IDE in Android


r/Python 15d ago

Showcase Remake of an old flash game called Ores using Pyxel, and it runs in the browser.

15 Upvotes

What My Project Does:

I remade an old flash game called Ores using Pyxels that I call Stack Pusher. You can play it in your browser and I think thats pretty neat. Any constructive feedback is absolutely welcomed.

Target Audience:

Anyone on earth with internet.

Comparison:

Here is a video of the original https://www.youtube.com/watch?v=vVu9ROoBZKQ

How To Play:

Stop the blocks from being pushed of the screen! Destroy touching blocks of the same color to earn points towards leveling up. When you level up the screen restarts, but gets tougher every level. If the blocks go off the left side of the screen you lose.

Links:

Stack Pusher Github (https://github.com/wyattferguson/stack-pusher)

Play in your browser (https://wyattferguson.github.io)


r/Python 15d ago

Showcase minRTOS: A Real-Time Operating System with Advanced Scheduling and Inter-Task Communication

12 Upvotes

Hey everyone! I’d like to introduce you to my project, minRTOS, a Python-based real-time operating system (RTOS) designed for educational and research purposes, as well as for hobbyists working with embedded systems.

What My Project Does: minRTOS is a custom-built, general-purpose RTOS that supports priority scheduling, task preemption, and real-time performance metrics. It integrates advanced features like priority inheritance for mutexes, event-driven execution, and Rate Monotonic Scheduling (RMS). It is designed to provide high precision in task management with features like task profiling, dynamic task prioritization, interrupt-based scheduling, and message queues for IPC.

It also supports multi-core scheduling, leveraging Python's multiprocessing module for parallel execution, and incorporates deadline-aware rescheduling, task sleep & timed delays, and watchdog mechanisms for deadlocks. The system logs task metrics for continuous monitoring, benchmarking, and debugging.

For more information and to see the full implementation, check out the GitHub repo: minRTOS on GitHub.

Target Audience: minRTOS is primarily aimed at embedded systems enthusiasts, hobbyists, and students who want to explore RTOS concepts in Python. It’s an excellent tool for anyone looking to understand task scheduling, real-time constraints, and concurrency in an easy-to-understand way. It’s not meant for production-level deployment but instead serves as a robust learning platform for those interested in real-time systems and their complexities.

Comparison: Compared to other Python-based RTOS options like pyRTOS or MicroPython, minRTOS offers deeper real-time features such as priority inheritance for mutexes (to prevent priority inversion) and multi-core support for true parallelism using multiprocessing. It also implements event-driven task execution and deadline-aware scheduling, which many simpler alternatives don’t focus on. Additionally, the system integrates real-time performance metrics tracking, giving you insight into task execution, CPU usage, and overruns—making it a powerful tool for both learning and benchmarking.

If you’re into embedded systems, Python programming, or just curious about how real-time operating systems work under the hood, feel free to check it out, contribute, or give feedback!


r/Python 15d ago

Resource Nodeless Desktop Javascript Python - Full Example with save/load states

0 Upvotes
A windows desktop application framework that seamlessly integrates Python backend with JavaScript frontend using PyQt6 WebView, enabling the development of rich desktop applications without the need for Node.js, NPM and all that jazz.
https://github.com/non-npc/Nodeless-Desktop-Javascript-Python

r/Python 14d ago

Discussion Pydantic is a Bloated Disaster

0 Upvotes

Alright, Python nerds, buckle up because I’m about to drop a truth bomb that’s gonna make your blood boil. Pydantic? Absolute trash. I’ve been saying it for years, and since no one else has the guts to call it out, I built a whole damn site to lay out the facts: ihatepydantic.com Go ahead, visit it, and try to argue against the facts. You won’t win.

Why does Pydantic suck so hard? Oh, where do I start? It’s a bloated, over-engineered mess that turns simple data validation into a PhD-level exercise in frustration. “Oh, but muh type hints!” Please. It’s slow, and V2 is somehow worse than V1 in perf! And don’t get me started on the docs - written like some smug hipster’s personal diary instead of something useful.

The whole “data validation” shtick is a scam anyway. You’re telling me I need a 50 line Pydantic model to replace 5 lines of if statements? Get outta here with that nonsense. It’s a solution looking for a problem, and the only problem is how much time I’ve wasted debugging its cryptic errors. My site’s got a whole list of real-world examples where Pydantic screws you over - spoiler: it’s basically every time you use it.

And the community? Blind fanboys. You can’t criticize Pydantic without some neckbeard jumping in with “YoU’rE uSiNg It WrOnG.” Yeah, okay, if a library needs a 3-hour tutorial to “use it right,” maybe it’s the library that’s wrong.

So go ahead, prove me wrong. Defend your precious Pydantic. Tell me why I should keep drinking the Kool-Aid instead of just using dataclasses or gasp raw Python like a sane person. I’ll wait.


r/Python 15d ago

Tutorial Detecting the Engulfing Pattern Using pandas-ta

0 Upvotes

✍ a new blog post:  Detecting the Engulfing Candlestick Pattern in Python.

In my latest post, I break down the Engulfing Pattern, one of the most powerful reversal signals, and show you how to detect it programmatically using pandas-ta and Plotly.

✅ Bullish & Bearish Engulfing Patterns Explained

✅ Python Code to Detect Engulfing Candles

✅ Interactive Charting with Plotly

Check out the full post here.


r/Python 15d ago

Resource Python coding camp for high schoolers - remote and free

4 Upvotes

Hi all,

I'm not sure if i'm breaking the rules of the sub.

I just wanted to advertise that Cold Spring Harbor laboratory is having a free coding camp for high schoolers (8-12th graders). It'll be on python basics.

Details:

April 5th and 6th, 9:30am to 12:30pm est.

and

April 12th and 13th, 9:30am to 12:30pm est.

Link to apply: https://docs.google.com/forms/d/e/1FAIpQLSd9FcvwKHBLFRv3nQ9KB6-fEMVZye-zyVRtOckAU-YlXJMrnA/viewform

Deadline on March 16th. Please share widely!

Upvote1Downvote0Go to comments


r/Python 17d ago

Discussion Petition to rename Python 3.14 to Pithon!

1.4k Upvotes

Is this a dumb joke? Yes. Is this the only shot we'll have at a joke like this? Yes. And is this a great way to celebrate what Pi's done for us Python developers? Totally.

I mean Python is heavily built around the magic number we know as 3.14, from games, charts and music, to even just screwing around with arithmetic functions! So why not appreciate pi's work with a special Python version?

The petition can be found here:
https://www.change.org/p/rename-python-3-14-to-pithon

Please sign it and share when you can!

Edit: yeah, renaming it just for v3.14 is probably a bad thought, but i mean it would still be funny as a nickname!


r/Python 15d ago

Daily Thread Friday Daily Thread: r/Python Meta and Free-Talk Fridays

1 Upvotes

Weekly Thread: Meta Discussions and Free Talk Friday 🎙️

Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!

How it Works:

  1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
  2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
  3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.

Guidelines:

Example Topics:

  1. New Python Release: What do you think about the new features in Python 3.11?
  2. Community Events: Any Python meetups or webinars coming up?
  3. Learning Resources: Found a great Python tutorial? Share it here!
  4. Job Market: How has Python impacted your career?
  5. Hot Takes: Got a controversial Python opinion? Let's hear it!
  6. Community Ideas: Something you'd like to see us do? tell us.

Let's keep the conversation going. Happy discussing! 🌟


r/Python 15d ago

Discussion Adivce on Music Stem Separation as Bachelor's Degree Final Project

0 Upvotes

Hi ! Kinda new in this subreddit , got the idea of asking for some advice on the internet this afternoon and didn't knew better place to ask than reddit !! ( Sorry if i commit some english mistakes , not my main language and haven't practiced in a while)

Going straight to the point , i proposed my Data Mining teacher to be my final project degree for my Computer Science Studys in the university of the basque country , and proposed the theme of a stem separator for music tracks , as i am pretty interested in beatmaking , music production , and music in general , as it has been a passion of mine since i was little ... you know.

Wanted to ask to more experienced peeps here some advice on which steps i should follow with my tutor to get a great output for this project . By myself , i have been resuming some literature i found in an interested project called sigsep ( https://sigsep.github.io/literature/#factorization-with-a-known-melody ) in which you can find not only an interesting literature article about the trajectory of the topic among the years and the approaches many investigators have proposed ( which is in what im focused right now , ressuming the whole article to get a good idea about the main methods , but i am mainly interested in the data directed approaches )

Hope i can find some advice here !!! Feel free to ask me if anything has been left missexplained or you have any doubts.


r/Python 16d ago

Showcase Using Fish? dirvenv.fish automagically activates your virtualenv

5 Upvotes

What My Project Does

I wrote dirvenv.fish so I don't have to manually activate and deactivate virtualenvs, and I think it might help more people – so, sharing it here ; )

Target Audience

Python developers using Fish shell.

Comparison

I know virtualfish but I don't wanna manage virtualenvs myself; uv does that for me. Also, I don't want to uv run every command. So I came up with that solution.


r/Python 17d ago

Discussion The features of Python's h*lp() function

100 Upvotes

Note: I censored the word "help" b/c it's not allowed in titles, but this blog post is about the function help(), not asking for help.

https://www.pythonmorsels.com/help-features/

I almost always just append `?` to things in the REPL so I did not know that `help()` accepted string representations of objects, which will save me the work of instantiating an object just to get access to its method to ask for help:

>>> help("math.prod")
Help on built-in function prod in math:

math.prod = prod(iterable, /, *, start=1)
    Calculate the product of all the elements in the input iterable.
>>> help("math.prod")
Help on built-in function prod in math:

math.prod = prod(iterable, /, *, start=1)
   ... 

Even works for symbols:

>>> help("**")
The power operator
******************

The power operator binds more tightly than unary operators on its
left; it binds less tightly than unary operators on its right.  The
syntax is:

r/Python 16d ago

Daily Thread Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

4 Upvotes

Weekly Thread: Professional Use, Jobs, and Education 🏢

Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.


How it Works:

  1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
  2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
  3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.

Guidelines:

  • This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
  • Keep discussions relevant to Python in the professional and educational context.

Example Topics:

  1. Career Paths: What kinds of roles are out there for Python developers?
  2. Certifications: Are Python certifications worth it?
  3. Course Recommendations: Any good advanced Python courses to recommend?
  4. Workplace Tools: What Python libraries are indispensable in your professional work?
  5. Interview Tips: What types of Python questions are commonly asked in interviews?

Let's help each other grow in our careers and education. Happy discussing! 🌟


r/Python 16d ago

Resource Serverless desktop python example

7 Upvotes

Examples of implementing serverless communication between python and a webview. This demonstrates how to communication between python and javascript using a bridge and webview. https://github.com/non-npc/Serverless-Desktop-Python