By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,844 Members | 1,859 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,844 IT Pros & Developers. It's quick & easy.

Debug a Python Program

P: 3
What command do I use to Debug a Python Program?
4 Weeks Ago #1
Share this Question
Share on Google+
2 Replies


P: 4
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.
4 Weeks Ago #2

P: 60
You can use pdb Python debugger. Commands listed here.
4 Weeks Ago #3

Post your reply

Sign in to post your reply or Sign up for a free account.