2

I am writing a Python code using curses library under Linux. Are there any debugger does not share the same terminal, so I can debug alone with the code running?

EDIT:

I tried WinPDB, but it works only with python 2.7, and I am using 3.3

xis
  • 24,330
  • 9
  • 43
  • 59
  • I don't know of such a debugger, but you could use `tail -f` on a logfile and [curses.wrapper](http://docs.python.org/2/library/curses.html#curses.wrapper) to make your life a bit easier. – Emmett Butler Oct 04 '13 at 15:52
  • @EmmettJ.Butler but I need to debug the curse code... – xis Oct 04 '13 at 15:54

1 Answers1

0

IPython supports embedding a “kernel” which can then connect to an external front-end, such as a Qt one (qtconsole).

For working with another tty, I’d suggest connecting the debugger with another tty either via a pair of pipes or a pty (pseudo terminal), although you’d probably have to write the “other half” to display in the terminal, whereas the qtconsole is already ready to use as-is.

You install the Debian package ipython-qtconsole (or the Py3k version ipython3-qtconsole), then just run “ipython qtconsole” on the command line to get a GUI window containing the debugger.

Embedding is also possible: you can modify your program to call the ipython “kernel” at some point which is like setting a breakpoint.

mirabilos
  • 5,123
  • 2
  • 46
  • 72
  • Also see http://stackoverflow.com/questions/14376469/ for info on problems when trying to embed the qtconsole. The detail depends on what you precisely need (pdb can be used inside IPython, or you can just embed an IPython kernel at some point in the script to inspect state, etc.) – lots is possible. – mirabilos Oct 04 '13 at 16:11