Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cleanest way to run/debug python programs in windows

Tags:

Python for Windows by default comes with IDLE, which is the barest-bones IDE I've ever encountered. For editing files, I'll stick to emacs, thank you very much.

However, I want to run programs in some other shell than the crappy windows command prompt, which can't be widened to more than 80 characters.

IDLE lets me run programs in it if I open the file, then hit F5 (to go Run-> Run Module). I would rather like to just "run" the command, rather than going through the rigmarole of closing the emacs file, loading the IDLE file, etc. A scan of google and the IDLE docs doesn't seem to give much help about using IDLE's shell but not it's IDE.

Any advice from the stack overflow guys? Ideally I'd either like

  • advice on running programs using IDLE's shell

  • advice on other ways to run python programs in windows outside of IDLE or "cmd".

Thanks,

/YGA

like image 926
10 revs, 7 users 53% Avatar asked Jan 15 '09 04:01

10 revs, 7 users 53%


People also ask

What is the best way to run Python on Windows?

To run Python scripts with the python command, you need to open a command-line and type in the word python , or python3 if you have both versions, followed by the path to your script, just like this: $ python3 hello.py Hello World!

Is Python difficult to debug?

In all programming exercises, it is difficult to go far and deep without a handy debugger. The built-in debugger, pdb , in Python is a mature and capable one that can help us a lot if you know how to use it.


1 Answers

For an interactive interpreter, nothing beats IPython. It's superb. It's also free and open source. On Windows, you'll want to install the readline library. Instructions for that are on the IPython installation documentation.

Winpdb is my Python debugger of choice. It's free, open source, and cross platform (using wxWidgets for the GUI). I wrote a tutorial on how to use Winpdb to help get people started on using graphical debuggers.

like image 199
gotgenes Avatar answered Sep 21 '22 09:09

gotgenes