473,386 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Debug a Python Program

What command do I use to Debug a Python Program?
Apr 25 '19 #1
2 1442
Abhays
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.
Apr 25 '19 #2
dev7060
636 Expert 512MB
You can use pdb Python debugger. Commands listed here.
Apr 25 '19 #3

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

Similar topics

3
by: Mike C. Fletcher | last post by:
Every few months I get to working on a Python C extension (built with distutils) and discover a pointer error or the like where I'd like to be able to step into my DLL and see where the extension...
1
by: kanji | last post by:
Hi ALL, I have written a multithreaded python program where each thread calls a C function (via Python/C extension module) to execute some tasks on a remote node. The number of threads == the...
5
by: Johnny Lee | last post by:
Hi, I've met a problem to understand the code at hand. And I wonder whether there is any useful tools to provide me a way of step debug? Just like the F10 in VC... Thanks for your help. ...
11
by: sushant.sirsikar | last post by:
hi, I am new to Python programming.I am not getting exactly pdb.Can anyone tell me effective way to debug python code? Please give me any example. Looking for responce. Thank You. Sushant
4
by: alf | last post by:
Hi, I have a two fold question: -how to attach the debugger to running multi threaded program -the objective is to find an infinite loop in one of threads which makes the whole thingy going...
2
by: Davy | last post by:
Hi all, How to debug Python program with GUI, especially Tkinter? My debug environment is PythonWin. For example, when I single step in the program, the step will go to mainloop() and always...
14
by: jmDesktop | last post by:
Hi, I'm trying to learn Python. I using Aquamac an emac implementation with mac os x. I have a program. If I go to the command prompt and type pythong myprog.py, it works. Can the program be...
8
by: karthikbalaguru | last post by:
Hi, One of my python program needs tkinter to be installed to run successfully. I am using Redhat 9.0 and hence tried installing by copying the tkinter-2.2.2-36.i386.rpm alone from the CD 3 to...
1
by: =?ISO-8859-1?Q?Andr=E9?= | last post by:
Hi everyone, I'd be interested in hearing suggestions as to the "best" way to drive a Python program step by step from another application. Details: --------- I have implemented a "Robot"...
0
by: agrawalanjita | last post by:
What command do we use to debug a Python program?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.