🌐
OnlineGDB
onlinegdb.com › online_python_debugger
Online Python Debugger - online editor
''' Online Python Debugger. Code, Run and Debug Python program online. Write your code in this editor and press "Debug" button to debug program.
🌐
Python Tutor
pythontutor.com › python-compiler.html
Visualize Python Code - Python Visualizer, Tutor, and Debugger with AI Help
Free online Python compiler and visual debugger. Step-by-step visualization with AI tutoring to learn data structures and recursion.
🌐
Visual Studio Code
code.visualstudio.com › docs › python › python-web
Run and Debug Python in the Web
November 3, 2021 - The extension comes with an integrated Python REPL. To activate it, run the command Python WASM: Start REPL. There is support for debugging Python files on the Web and it uses the same UI as VS Code Desktop debugging.
🌐
Online Python
online-python.com › 1k7INt4ZCl
Online Python - IDE, Editor, Compiler, Interpreter
Online Python IDE is a web-based tool powered by ACE code editor. This tool can be used to learn, build, run, test your python script. You can open the script from your local and continue to build using this IDE. Code and output can be downloaded to local. Code and output can be downloaded to local.
integrated development environment for development in Python
PyCharm is an integrated development environment (IDE) used for programming in Python. It provides code analysis, a graphical debugger, an integrated unit tester, integration with version control systems, and supports web development … Wikipedia
Factsheet
Developer JetBrains
Initial release 3 February 2010; 16 years ago (2010-02-03)
Stable release 2025.3.2.1
/ 2 February 2026; 45 days ago (2 February 2026)
Factsheet
Developer JetBrains
Initial release 3 February 2010; 16 years ago (2010-02-03)
Stable release 2025.3.2.1
/ 2 February 2026; 45 days ago (2 February 2026)
🌐
JetBrains
jetbrains.com › pycharm
PyCharm: The only Python IDE you need
June 2, 2021 - Built for web, data, and AI/ML professionals. Supercharged with an AI-enhanced IDE experience.
Top answer
1 of 15
409

Yes! There's a Python debugger called pdb just for doing that!

You can launch a Python program through pdb via python -m pdb myscript.py.

There are a few commands you can then issue, which are documented on the pdb page.

Some useful ones to remember are:

  • b: set a breakpoint
  • c: continue debugging until you hit a breakpoint
  • s: step through the code
  • n: to go to next line of code
  • l: list source code for the current file (default: 11 lines including the line being executed)
  • u: navigate up a stack frame
  • d: navigate down a stack frame
  • p: to print the value of an expression in the current context

If you don't want to use a command line debugger, some IDEs like Pydev, Wing IDE or PyCharm have a GUI debugger. Wing and PyCharm are commercial products, but Wing has a free "Personal" edition, and PyCharm has a free community edition.

2 of 15
87

By using Python Interactive Debugger 'pdb'

First step is to make the Python interpreter enter into the debugging mode.

A. From the Command Line

Most straight forward way, running from command line, of python interpreter

$ python -m pdb scriptName.py
> .../pdb_script.py(7)<module>()
-> """
(Pdb)

B. Within the Interpreter

While developing early versions of modules and to experiment it more iteratively.

$ python
Python 2.7 (r27:82508, Jul  3 2010, 21:12:11)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pdb_script
>>> import pdb
>>> pdb.run('pdb_script.MyObj(5).go()')
> <string>(1)<module>()
(Pdb)

C. From Within Your Program

For a big project and long-running module, can start the debugging from inside the program using import pdb and set_trace() like this:

#!/usr/bin/env python
# encoding: utf-8
#

import pdb

class MyObj(object):
    count = 5
    def __init__(self):
        self.count= 9

    def go(self):
        for i in range(self.count):
            pdb.set_trace()
            print i
        return

if __name__ == '__main__':
    MyObj(5).go()

Step-by-Step debugging to go into more internal

  1. Execute the next statement… with “n” (next)

  2. Repeating the last debugging command… with ENTER

  3. Quitting it all… with “q” (quit)

  4. Printing the value of variables… with “p” (print)

    a) p a

  5. Turning off the (Pdb) prompt… with “c” (continue)

  6. Seeing where you are… with “l” (list)

  7. Stepping into subroutines… with “s” (step into)

  8. Continuing… but just to the end of the current subroutine… with “r” (return)

  9. Assign a new value

    a) !b = "B"

  10. Set a breakpoint

    a) break linenumber

    b) break functionname

    c) break filename:linenumber

  11. Temporary breakpoint

    a) tbreak linenumber

  12. Conditional breakpoint

    a) break linenumber, condition

Note: All these commands should be executed from pdb

For in-depth knowledge, refer:

  • https://pymotw.com/2/pdb/

  • https://pythonconquerstheuniverse.wordpress.com/2009/09/10/debugging-in-python/

Find elsewhere
🌐
CodeHS
codehs.com › tutorial › calvin › using-the-python-debugger
Tutorial: Using the Python Debugger | CodeHS
CodeHS is using the industry standard built-in Python debugger, PDB, to pause and step through your Python programs.
🌐
CodeChef
codechef.com › python-online-compiler
Online Python Compiler and Visualizer
Welcome to our AI-powered online Python compiler and interpreter, the perfect platform to run and test your Python code efficiently. Our tool makes coding easy for developers of any skill level, whether you're a beginner or experienced.
🌐
Reddit
reddit.com › r/learnpython › online python debugger/code sharer
r/learnpython on Reddit: Online Python Debugger/Code Sharer
June 14, 2014 -

Hi all! I stumbled across this subreddit a few months ago, and was impressed with the scene here. Y'all seem more mature and purely want to learn/share knowledge, unlike other places that seem to get clogged up with "here's my homework do it for me" type requests. I made a mental note to come back when I got some projects of mine into stable/usable states.

I'm a programmer (big generalization) by day, and am constantly helping coworkers/friends/family/etc with programming and computer questions and concepts. Long story short, I got fed up with the available online code-sharing/debugging tools, and wrote my own. (I was also looking for an excuse to use some new technologies).

I'm rather proud of the work I did on them. Anyways, just wanted to share them and let y'all know that there's some new (and IMO better, but I'm pretty biased) tools out there for sharing/debugging code samples and helping others learn.

These are my two sites that are finally at version 1.0 (maybe still a bit beta though)

  • dbgr.cc - online code debugger/sharer - only python (my favorite) is currently supported for debugging - I'll be implementing other languages soon-ish

  • noobcoderz.com - tutorial site that uses the online debugger for code examples. I only have a general programming tutorial section and a bit of a python section up right now.

I see dbgr.cc being most useful for code sharing/debugging for r/learnpython though.

I hope they're as useful as I've imagined them to be. If not, oh well, they were fun to make.

Thanks for reading!

-n

🌐
Python
wiki.python.org › moin › PythonDebuggingTools
PythonDebuggingTools
For current information, please visit python.org. If a change to this archive is absolutely needed, requests can be made via the infrastructure@python.org mailing list. Add your useful tools here -- editors, debuggers and other utils that really help with the process.:
🌐
Workik
workik.com › ai-powered-python-code-debugger
FREE AI-Powered Python Code Debugger – Debug Python Code Efficiently
Enhance your Python debugging with Workik AI: Automated bug detection, performance optimization, & more. AI Debugs Django, flask, pyramid, & more
🌐
Programiz
programiz.com › python-programming › online-compiler
Online Python Compiler (Interpreter) - Programiz
Write and run your Python code using our online compiler. Enjoy additional features like code sharing, dark mode, and support for multiple programming languages.
🌐
Python Tutor
pythontutor.com
Python Tutor - Python Online Compiler with Visual AI Help
Free online compiler and visual debugger for Python, Java, C, C++, and JavaScript. Step-by-step visualization with AI tutoring.
🌐
Visual Studio Code
code.visualstudio.com › docs › python › debugging
Python debugging in VS Code
November 3, 2021 - For general debugging features such as inspecting variables, setting breakpoints, and other activities that aren't language-dependent, review VS Code debugging. This article mainly addresses Python-specific debugging configurations, including the necessary steps for specific app types and remote debugging.
🌐
HackerRank
hackerrank.com › domains › python
Solve Python Code Challenges
Python Functionals · Regex and Parsing · XML · Closures and Decorators · Numpy · Debugging ·
🌐
Python Online
pythononline.net
Python Online - Editor, Compiler, Interpreter, IDE
Launched the first version of Python Online · Implemented basic code editing features · June 2024 · Now you can create multiple tabs · Implemented syntax highlighting · October 2024 · Python packages can now be installed · Sharing feature added · September 2025 · Automatic Package Installation: No more manual installs! Just import a supported package, and we handle the download for you. Coming Soon! Working on adding an interactive terminal · Planning to add debugging tools ·
🌐
Domsignal
domsignal.com › home › python online compiler | one-stop solution for code testing and debugging
Python Online Compiler | One-Stop Solution for Code Testing and Debugging
Compile and run Python code online with Domsignal Compiler free tool. No need to install any software; write, test, and debug Python code in your browser.
🌐
Playcode
playcode.io › python-compiler
Python Online - Run Python Code Free in Browser | PlayCode
Validate your logic before adding it to larger projects. Debug individual functions in isolation. Share Python code examples with students via simple URLs. No software installation required for students to run and modify code. Perfect for classrooms and online courses.
🌐
NextLeap
nextleap.app › online-compiler › python-programming
NextLeap - Online Python Compiler
Code, compile, and run Python with NextLeap's fastest python online compiler. Enjoy features like real-time output, code sharing, dark mode, library support, and collaborative coding.
🌐
BairesDev
bairesdev.com › home › blog › software development
Best Python Debugging Tools in 2025
Learn about the top Python debugging tools and their key features to choose the right tool for you.