Cleanest way to run/debug python programs in windows

35,170

Solution 1

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.

Solution 2

You can easily widen the Windows console by doing the following:

  • click the icon for the console window in the upper right
  • select Properties from the menu
  • click the Layout tab
  • change the Window Size > Width to 140

This can also be saved universally by changing the Defaults on the menu.

Solution 3

Year 2017-2019 Answer:

Try Visual Studio Code, it has great support for Python debugging, auto completion and more!

See this link for details: https://code.visualstudio.com/docs/languages/python#_debugging

Solution 4

I use eclipse with pydev. Eclipse can be sluggish, but I've become attached to integrated svn/cvs, block indent/unindent and run as unittest features. (Also has F5 run)

If your comfortable in emacs though I don't see any reason to make such a major change.

I suggest instead that you replace your 'crappy command prompt' with powershell. It's not as crappy.

(As mentioned by Soviut and The Dark - you can increase the buffer width/window size to more than 80 by title-bar>right-click>Properties>Buffer Width/Window Size edit even in crappy cmd)

Solution 5

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.

Click on the system box (top-left) in the command prompt and click properties. In the layout tab you can set the width and height of the window and the width and height of the screen buffer. I recommend setting the screen buffer height to 9999 so you can scroll back through a long output.

Share:
35,170
YGA
Author by

YGA

Updated on August 05, 2022

Comments

  • YGA
    YGA almost 2 years

    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