[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fri, 6 Nov 2009 03:42:44 -0800 (PST)
Hi, apologies in advance for a potentially numpty post.
I've been using Emacs for a little while now, but I've yet to settle
on a satisfactory python edit-run-debug cycle, and I was wondering
what wiser minds than mine have settled upon. So far I've tried:
* Edit code and run with emacs PDB. After fiddling the lisp code to
automatically pick up the current buffer as the default run candidate,
this is nearly okay. The main issue is that, after editing code,
there's no easy way to rerun the code, so I end up killing the gud
buffer every time. As such, entering and leaving the debugger is quite
a few key presses and accidentally leaving it running is also easy.
* Tried Pydb to similar effect.
* Run everything in a seperate shell. And debug by hand. This is a
little too low-fi, even for me.
* Use the 'import/reload file' and 'eval def/class' functions, and run
everything from the emacs python shell, using pdbtrack to help with
debugging. Problems so far:
*** It's very easy to forget which modules you've modified and fail to
reload them; because the state is carried over I continually find
myself running the old versions of code I've just edited, especially
if it's across several files.
*** More than that, sometimes the stuff I expect to reload simply
doesn't, and I have no indication as to why. For example, if pdb has
module open and you stick a deliberate error in the code and reload
it, the minibuffer tells you the module has been loaded, even though
it clearly can't have been.
*** I have to run pdb.pm() to debug the exception. If I run *anything*
else by accident, I lose the exception context. This can be annoying
if you're incompetent enough to keep making typos (I am).
Does anyone have any tips on their workflow?
|[Prev in Thread]
||[Next in Thread]|
- Python workflow,