[wingide-users] I/O while debugging
Wing IDE Support
support at wingware.com
Sun Dec 26 01:42:21 EST 2004
On Sat, 25 Dec 2004, Charles Hartman wrote:
> A newbie question, or rather several:
> While I'm debugging a module (using Debug Current File), I want to
> supply test inputs. I've given the module code for that (outside the
> class to which the module is mostly devoted):
> st = raw_input()
> while st != "quit":
> res = s.Syllabize(st)
> print res
> st = raw_input()
> I hit Debug Current File, then type some input (a word) in the Debug
> I/O window, and see the results there. Well, once. If I then quit
> (either way) and fix something and try again, WingIDE crashes. Using
> input(prompt) doesn't seem to help; anyway it just calls raw_input.
> What basic fact(s) about I/O, and/or the IDE, am I forgetting? What's
> the right way to do this?
First, make sure you're using the latest version of Wing (2.0.1). There
were some bugs with this in older versions.
If you are using 2.0.1, try using an external console to see if that
solves the problem. There is extra I/O multiplexing code in the debug
process when you're using the integrated I/O panel, and it's possible
there is a problem with it in your case. You can set Wing to use an
external console from the Options menu in the Debug I/O tool.
If that is indeed indicating a bug, please submit a but report from
the Help menu and select the "include error log" checkbox.
> Also related -- maybe: As far as I can tell, using the syntax
> sre.compile(r""" . . . """)
> doesn't work. It acts as though the r flag isn't there.
The debugger should show the string correctly but won't put an 'r' in
front of the string because the notion of a raw string only exists at the
source level and not once the string has been created in memory by the
interpreter. Unicode strings should show 'u' before the string in the
> Another topic: I see that while using Debug Current File it's not
> possible to set breakpoints. Is that a feature, a bug, an oversight, or
> a misunderstanding on my part?
It should be possible to set a breakpoint on any Python code. One thing
to check is whether Wing sees your particular file as Python (the keywords
"def", etc, should be syntax highlighted). Also, if you mean that while
your debug process is running and in a raw_input() that you can't set a
breakpoint, that might also be fixed by using an external console. Wing
should keep the debug process responsive while in a raw_input() but there
is special code that makes that so, and if you're encountering bug you may
not be able to Pause or set breakpoints at that point in time (but you
should always be able to set break points before starting the debug
> Am I right that while I can check values (in Stack Data) using
> breakpoints, in the Personal Edition there's no way to Watch a
> variable, that is, no way to set a conditional breakpoint?
Yes, correct. Personal omits conditional and other forms of breakpoints
and also omits the watch manager, debug probe, and other more advanced
debugging tools. You can use Wing IDE Pro on a free trial from
http://wingware.com/wingide/trial if you and to try out those features.
Hope that helps... please let us know if not.
Wing IDE for Python
Advancing Software Development
More information about the wingide-users