Darrell Hawley: Home Page

Saturday, December 13, 2008

Note to Self 4 - Python Editors, Debuggers, stdout and stderr

  • PyScripter has been IDE of choice for Python, but I've run into some problems with it. I would have continued to use it, but I noticed that the latest anyone did any work on it was October of 2006 - or at least that's what I thought. It turns out that early this year PyScripter is now maintained in Google Code and supports Python 2.6. You can download it here.
  • I've started using Notepad++ for editing my Python. Though it's only an editor, it uses syntax highlighting, supports macros and allows me to define hot keys to run external programs. This last point makes it possible for me to launch my code in Python with a simple keypress.
  • Want to know how to use Notepad++ to launch the file you're currently editing in Python? Type "[%Python directory%]\python.exe "$(FULL_CURRENT_PATH)" into the Notepad++ Run dialog and then save it to the keystroke combination of you choice.
  • If you took my previous bullet point to heart, you'll find that Python launches in a command window and then promptly closes after your tests run losing any output you may have had. The only way that I've been able to solve this is by pointing the stdout and stderr to a file. I would prefer to override the these when I launch Python, but instead I have to put some addtional code into my application. Bummer.
  • WinPDB is a debugging tool for Python. The only tool I'd used for debugging in the past is the one embedded into PyScripter. When I started using Notepad++ as my editor, I started trying to debug from the command line using the PDB module. No fun. That's when I came across WinPDB. It's worked well for the past few days that I've been using it, but it still isn't as nice as having your debugger integrated into your environment.

0 Comments:

Post a Comment

<< Home