Debug a Python Program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • karan991136
    New Member
    • Apr 2019
    • 3

    Debug a Python Program

    What command do I use to Debug a Python Program?
  • Abhays
    New Member
    • Apr 2019
    • 4

    #2
    To start debugging, we first open the command prompt, and get to the location the file is at.

    Microsoft Windows [Version 10.0.16299.248]

    (c) 2017 Microsoft Corporation. All rights reserved.

    C:\Users\lifei> cd Desktop
    C:\Users\lifei\ Desktop>

    Then, we run the following command (for file try.py):

    C:\Users\lifei\ Desktop>python -m pdb try.py
    > c:\users\lifei\ desktop\try.py( 1)<module>()
    -> for i in range(5):

    (Pdb)

    Then, we can start debugging.

    Comment

    • dev7060
      Recognized Expert Contributor
      • Mar 2017
      • 656

      #3
      You can use pdb Python debugger. Commands listed here.

      Comment

      Working...