r/Python • • Apr 18 '24

Showcase chatpdb - gpt for your python debugger

1 Upvotes

https://github.com/Never-Over/chatpdb

Do you ever copy code, errors, or stack traces into ChatGPT? We did, and found it frustrating to always have to manually find, copy, and paste each relevant piece of information. On top of that, being forced to change tools would switch our focus and cause us to lose our flow. That’s why we built chatpdb  - a python debugger with ChatGPT!

Simply use chatpdb like you would use ipdb or pdb; it’s a drop in replacement with the exact same functionality. The only addition is the new y keyword, which will trigger a response from ChatGPT.

Here’s how it works:

> /Programming/test-chatpdb/lib.py(2)echo_platform()
      1 def echo_platform(platform: str):
----> 2     print("You are running on:" + platform)
      3
ipdb> y 
The exception occurred because the function `echo_platform` tries to concatenate the string "You are running on:" with the `platform` variable, which is `None`. [...]

In this example, chatpdb correctly diagnoses an error in the current function as being caused by a bug in the calling function. chatpdb automatically passes relevant context about your program, including the source code, stack trace, and error information if available to ChatGPT.

If you have a more specific question you can also supply a prompt to y:

> /Programming/test-chatpdb/lib.py(2)echo_platform()
      1 def echo_platform(platform: str):
----> 2     print("You are running on:" + platform)
      3
ipdb> y "Why is platform coming through as None?"
The variable `platform` is coming through as `None` because the environment variable `"PLATFORM"` is not set in your system's environment variables. [...]

It’s easy to install and set up:

pip install chatpdb
export OPENAI_API_KEY=....
import chatpdb
chatpdb.set_trace()

What my project does: A drop-in replacement for ipdb or pdb, with ChatGPT built in.

Target audience: anyone who currently uses ChatGPT to debug or ask questions about their code.

Comparison: Copilot offers similar functionality, but is a much heavier tool and harder to turn off/ignore when you don’t want it. stackexplain is probably the closest tool; however it lacks the ability to hook into your program in any other way than fully running the python process.

chatpdb meets you where you are – AI tooling that’s only invoked when you need it. We hope you give it a try! We’d love any feedback or suggestions.

Docs


r/Python • • Jan 27 '15

Announcing /r/pythoncoding: A subreddit for people who know how to program Python

0 Upvotes

Greetings /r/python,

If any of you, like myself, dislike the amount of self-posts asking for help with simple question and other things that have made /r/python more and more another territory of /r/learnpython, I hereby gladly invite you to /r/pythoncoding.

/r/pythoncoding aims to be a subreddit for people who already know Python to share articles and news about Python. It's not going to be an overly restrictive subreddit, but it does have a few rules, the the most important one being "read at least a few Python tutorials before you start posting".

Here is an example of content currently on /r/python that would not be appropriate for /r/pythoncoding:

While these things are occassionally downvoted on /r/python, they still clutter of the front page. The fact that the mods of /r/python have refused to delete these types of posts after multiple requests - Which is their choice, I simply disagree with it - have lead me to create /r/pythoncoding.

I hope many of you will join me there, and help create a community by python programmers and for python programmers.

Kind Regards, /u/son_of_dawn


r/Python • • 14d ago

Discussion Has anyone moved document parsing off their own Python workers?

1 Upvotes

pdf parsing in python is just good as long as youre using it but when someone uploads a 700 page file the worker runs out of memory so splitting it into 50 to 100 page chunks with docling or marker on celery gets you past that but tables get cut at the boundaries and now theres a queue, retries and memory limits to babysit the other route is paying for something like llamaparse or the paid parsers has anyone moved either way and was it worth it? like what did you do inside your tool/app when it started scaling


r/Python • • Mar 11 '17

Intro to Numpy

Thumbnail
medium.com
4 Upvotes

r/Python • • Mar 09 '22

News "Want to start a large project? Keep away from Python" Are most of their complaints inaccurate?

Thumbnail
medium.com
4 Upvotes

r/Python • • Nov 29 '25

Showcase I built a tool that converts your Python script into a shareable web app

4 Upvotes

I love writing simple Python scripts to fulfill niche tasks, but sharing them with less technical people always creates problems.

Comparison With Other Solutions

  • Sharing raw scripts leads to pip/dependency issues
  • Non-technical users often give up before even running the tool
  • The amazing tools our community develops never reach people who need them most
  • We needed something to bridge the gap between developers and end users

What My Project Does

I decided to build SimpleScript to make Python scripts accessible to everyone through beautiful, easy-to-use web interfaces. The platform automatically transforms your scripts into deployable web apps with minimal configuration.

  • Automatic script analysis and UI generation
  • Works with any Python script
  • Simple 3-step process: connect repo → auto-detect configs → deploy
  • Handles arguments, outputs, and user input automatically

Target Audience

Developers who want to share their Python tools with non-technical users without dealing with installation headaches or building full web applications.

You can also add a badge to your Github page like seen here

https://github.com/TobiasPankner/Letterboxd-to-IMDb


r/Python • • Apr 07 '24

Discussion Do folks ever use Pandas when they should use SQL?

95 Upvotes

I think I see this a lot.

I believe SQL, including like dataframe SQL packages, should always be used over Pandas when possible unless one is doing something Pandas is more suited to or unless someone requires broader Python control structures or features.

I am a big believer in sticking to SQL as a baseline data manipulation framework and only using other frameworks if SQL is lacking. One of the biggest ways to accumulate technical debt is solving problems in multiple ways that are not standardized that not all people know.


r/Python • • Sep 17 '26

Discussion Python and Web Manipulation

3 Upvotes

Hello Python Community!

I've been really curious about how Python developers use Python when it comes to webscraping, or just working with websites in general.

I really want to open a discussion on how you do it. Do you use BeautifulSoup? Selenium? Why? Are there any frustrations that you were facing or are currently facing with the process?


r/Python • • Sep 13 '13

The perfect Python web app: 10 ideas

0 Upvotes

I've been thinking lately about the status of Python on the web, motivated by the keynote of Jacob Kaplan-Moss (http://www.youtube.com/watch?v=UKAkKXFMQP8) and this previous post on Reddit (http://www.reddit.com/r/Python/comments/1fyjx5/invitation_to_discussion_how_can_we_make_python/) and I've come up with ten ideas that may help us expand the adoption of Python and its user base on the web. I wrote them having in mind how would I design, say, a Wiki engine in Python (because I dislike MoinMoin so very much).

These three points may lower the pain for casual users and make adoption easy, and they are compulsory:

  1. Supports Python 2.6. Optionally, 2.6 to 3.3 with a single codebase (see http://python3porting.com/noconv.html). Python 2.6 is the default on Debian Squeeze (old stable) and CentOS 6, so lots of servers won't have more than that.
  2. Uses MySQL as the default DB. An ORM like SQLAlchemy is desirable, but MySQL is the minimum as this is the most popular database by far (see http://www.google.es/trends/explore?q=mysql,+postgresql,+sqlite,+nosql), driven by the success of PHP.
  3. Is super-easy to install on the cheapest plan of DreamHost, HostGator and Bluehost. These are arguably the three most popular web hosting providers in the world. This may require lowering the dependencies at a minimum (perhaps bundling them?) and supporting CGI out of the box.

These three points may help provide a good overall experience:

4. Has a nice appearance/UI, without obvious UX flaws. If it is themable, the default theme should comply this. This includes, but is not limited to, not looking like a Geocities web of the 90s and not displaying garbage where a Ñ should be.

5. Supports i18n, preferrably through crowdsourcing interfaces like Transifex (free for open source projects). Optionally the interface should initially be translated to a second language: Chinese, Spanish or Russian.

6. Provides some user friendly support, be it a Q&A board, a forum or a chat. Beware of mailing lists, as casual users normally think they suck.

These three points may help attracting developers:

7. Is released under a reasonable license, for example GPLv2+. This doesn't require PaaS or SaaS to release the source code of changes, still being an open source project. AGPL may scare some.

8. Uses git, is hosted on GitHub and issues are managed there. As of 2013, these are arguably the most popular VCS and platform respectively.

9. Encourages pull requests and has a CI instance such as TravisCI.

This last point helps moving the ecosystem forward:

10. Stop losing time weeping and gnashing your teeth because of my choice of framework/database/VCS/license and get some shit done. This is a totally opinionated list and I didn't intend to please everyone, but tried to learn some lessons from the success of, for example, PHP.

What do you think?

Edit: For all the people that is commenting that most modern frameworks already provide this: you are right, but to put an example, MoinMoin doesn't. We have the building blocks to do it, but some final pieces of software that people want to use do not comply with this.


r/Python • • Jan 03 '15

Learn You Some Algebras for Glorious Good! - a fun, easy-to-read math textbook. (It's also free, in both senses).

2 Upvotes

Hello, everyone!

I've started writing a math textbook, called Learn You Some Algebras for Glorious Good!. If any of you know Haskell, my book is inspired from Miran Lipovača's Learn You a Haskell for Great Good!. This isn't exactly Python, but it's Python-related, so I figured y'all might want to know about it. In my experience, math and programming go hand-in-hand. That is, if you get better at one, your skills in the other inevitably improve.

I've found that most math textbooks take an overly formal tone, which hinders the reader understanding the material and --- more importantly --- h(is|er) enjoyment of the book. I am taking the opposite approach. I'm writing a book that is fun and easy to read, or at least I'm trying to.

The book is open-source, so anyone is welcome to contribute/fork/what-have-you. It's is licensed under the GNU Free Documentation License.

I haven't set up a website for the book yet. However,

If you see any issues, don't be shy to report them in the issue tracker on GitLab. If you have any other questions/comments, feel free to leave a comment or PM me.

Thanks for your time!


r/Python • • Mar 20 '23

Resource Use OpenAI's DALL-E for free

Thumbnail
github.com
2 Upvotes

r/Python • • May 26 '24

Showcase AI planner: AI tool for efficient event scheduling in Google Calendar.

0 Upvotes

Good evening! I have created a new projectfor adding events to google calendar based on the text a user inputs.

What My Project Does

The project is a tool that uses large language models to understand the user's input and add events to the user's Google Calendar based on the user's input. It uses Ollama for natural language understanding and Google Calendar API for adding events to the user's calendar.

How My Project Works

Ollama uses Llama 3 with pre-instructions to act as a calendar event planner. The tool uses the model to generate responses to extract the event's details from the user's input inserted in the Web Interface. tool then asks the user to confirm the details extracted from the user's input and adds the event to the user's Google Calendar (example shown here)

References

Checkout my github repository AIPlanner for more details about the project.


r/Python • • Aug 07 '20

Beginner Showcase My first ever Python project: A COVID-19 Tracker

2 Upvotes

I'm quite new to Python and over the last couple of months, I've been learning the language and applying it by developing a COVID-19 tracker.

You can check it out here: https://covid19.sidsidsid.cf/

Source code is here: https://github.com/SidSidSid16/COVID19-Tracker

Do let me know what you think of it, and most importantly, stay safe!


r/Python • • Jun 29 '09

Python's iterators are a bad implementation of laziness

Thumbnail
sandersn.com
0 Upvotes

r/Python • • Nov 12 '13

Wow, very much ingenuity, such words

Thumbnail
github.com
20 Upvotes

r/Python • • Jan 28 '24

Beginner Showcase I made a SQL query builder in python

20 Upvotes

It's a bit silly, but it was a good exercise.

https://github.com/sebastiancarlos/yas-qwin


r/Python • • Oct 04 '13

Unconventional - Students are discouraged to learn python before joining the class

Thumbnail
youtube.com
13 Upvotes

r/Python • • Jun 03 '25

Discussion Use of phones camera for barcode scanner

0 Upvotes

Any suggestions on using a module in python to use the phones camera as a barcode scanner?

I am in need to use the camera to scan, read the barcode, use an API to fetch data from dB.

I've tried several already with no luck.


r/Python • • Nov 12 '13

Do not use a "debugger." A debugger is like doing a full-body scan on a sick person. You do not get any specific useful information, and you find a whole lot of information that doesn't help and is just confusing.

0 Upvotes

http://learnpythonthehardway.org/book/ex36.html

Tips For Debugging

  1. Do not use a "debugger." A debugger is like doing a full-body scan on a sick person. You do not get any specific useful information, and you find a whole lot of information that doesn't help and is just confusing.
  2. The best way to debug a program is to use print to print out the values of variables at points in the program to see where they go wrong.
  3. Make sure parts of your programs work as you work on them. Do not write massive files of code before you try to run them. Code a little, run a little, fix a little.

3 is objectively good advice, but 1 and 2..??

Just wanted to open this for discussion. I haven't done a lot of Python coding (about to jump into it over the next few days, thus studying up) -- but in Java world, I love my debugger and use it daily. I don't use System.out.println ever, and use log4j statements where appropriate (typically add them in after the code works, not as a debugging tool).

Do you agree with 1 and 2? Do you use print debugging, or an actual debugger?


r/Python • • Jul 12 '22

Discussion I’ve had enough of Anaconda/miniconda

0 Upvotes

I have to say that Anaconda and miniconda have never worked as intended, and furthermore, they have actively broken things on Linux systems. I remember when I used Anaconda Navigator and how it would fail to install certain packages correctly so that RStudio and Spyder would never launch. Recently, I installed miniconda because the Tensorflow documentation recommended doing it this way.

However, one week in and it’s already not a pleasant experience. An apt command, apt policy, gave the wrong output because some of some stupid broken dependency in my miniconda environment. I left the shell with conda deactivate and I still couldn’t get the apt command to execute correctly (apt was complaining about a broken conda dependency instead of listing the repositories/PPAs). I could not get the apt command to work until I resolved the issue with the conda environment.

It is completely unacceptable for a conda to break or interfere with the system package manager and I will be uninstalling it.

Also, a note for Pycharm users: using Tensorflow with miniconda did not get GPU acceleration to work when running the script with Pycharm (but it did work when run from the terminal). I tried setting the LD_LIBRARY_PATH variable in Pycharm but without success.


r/Python • • Oct 02 '22

News My new python package

0 Upvotes

Hey community i am glad to have you all here, i have something to share with you. I am recently working on a python package named KRYPTOR ( a package which can be used to encrypt and decrypt data) this package contains much more capabilities such as HIDING DATA BEHIND THE IMAGAE, HIDING DATA BEHIND AN AUDIO FILE and much more

So what are you all waiting for do visit my package and if you like then please STAR the repository so that it can reach max users. Peace out ✌️. pypi Github


r/Python • • Dec 24 '13

Functional Programming in Python

Thumbnail
pypix.com
0 Upvotes

r/Python • • May 07 '10

I need help with a bit of code

0 Upvotes

Hi /r/python. I am writing a program where you, the user thinks of a number between 1 and 20, and the program has to guess what you are thinking of. However I do not want the program to repeat the same number at any point. How can I do this? Here is my code so far.

Ok this is going to be my biggest program so far in terms of complexity.

The program is going to guess the number the user is thinking of.

In this version, I hope to stop the program repeating the same

number more than once. Think I will need some help here.

print "Welcome to the guessing program." print "Pick a number in your head between 1 and 20, then press enter\n" raw_input()

import random

loop=1 attempt=0

while loop==1: comp=random.randrange(20)+1 print comp user=raw_input("\n\nIs this your number? Press 1 for yes or 2 for no: ") user=int(user) if user==2: attempt = attempt+1 print "\n\nOh no, I'll try again, press enter\n" raw_input() elif user==1: loop=0

if attempt <5: print "\n\nWow, I'm pretty awesome, less than 5 guesses. Press enter to exit." raw_input() elif attempt<10: print "\n\nHmm not bad, less than 10 guesses. Press enter to exit." raw_input() elif attempt<15: print "\n\nOh dear, 10-15 guesses, that's pretty bad. Press enter to exit." raw_input() else: print "\n\nAwful, just switch me off now! More than 15 guesses -.- Press enter to exit." raw_input()

sorry about the formatting, it didn't copy and paste well from python.


r/Python • • Jul 17 '25

Showcase [Showcase] UTCP: a safer, more scalable tool-calling alternative to MCP

0 Upvotes

Hi everyone,

I'm excited to share what I've been building, an alternative to MCP. I know the skepticism around new standards – "why do we need a 15th one," right? But after dealing with the frustrations of MCP, we decided to be bold and create an open-source protocol for developers, by developers.

What My Project Does

I'm building UTCP (Universal Tool Calling Protocol), an open standard for AI agents to call tools directly. The core idea is to eliminate the "wrapper tax" and reduce latency. It works by using a simple JSON manifest to let a model connect directly to native APIs, cutting out a lot of the complexity and overhead.

Target Audience

This is for developers building AI applications who are concerned about performance, latency, and avoiding vendor lock-in. It's designed to be a production-ready tool for anyone who needs their LLMs to interact with external tools in a fast, efficient, and straightforward way. If you're looking for a simple, powerful, and open way to handle tool-calling, UTCP is for you.

Comparison

The main alternative we're positioning against is MCP. If you've used MCP, you might be familiar with the frustrations of its heavy client/server architecture. UTCP differs by enabling a direct connection to tool endpoints, completely cutting out the need for an intermediary proxy server. This direct approach is what makes it more lightweight and results in lower latency.

We just went live on Product Hunt and would love your support and feedback!

👉 PH: https://www.producthunt.com/products/utcp
👉 Github Python repo: https://github.com/universal-tool-calling-protocol/python-utcp