Wed, 21 Sep 2005, Bob Nienhuis wrote:
When I do:
import sys
sys.exit(0)
I get:
Traceback (most recent call last):
File "C:\Python24\Lib\site-packages\pythonwin\pywin\scintilla\bindings.py",
line 141, in fire
rc = apply(binding.handler, args)
File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\interact.py",
line 478, in ProcessEnterEvent
if self.interp.runsource(source, "<interactive input>"): # Need more input!
File "C:\Python24\lib\code.py", line 87, in runsource
self.runcode(code)
File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\interact.py",
line 257, in runcode
exec code in self.globals, self.locals
File "<interactive input>", line 1, in ?
SystemExit: 0
, good, thanks for the error message: that clears up exactly what's
going on. (Actually, that looks like a bug in PythonWin: it should handle
that particular situation a little bit more cleanly.)
Bob, what's happening is just the nature of the command you're executing:
sys.exit() is telling Python to exit. But since the PythonWin text editor
itself depends on Python staying up, it rejects the exit command, as it
should!
Your interpretation that it was "asking for more input" wasn't accurate.
Instead, the error message is saying: "The user gave me this interactive
input command for me to run, but when I did, it raised an exception that I
don't know how to handle. I'll spit out this debugging information for
something to inspect."
So try different module functions besides sys.exit(). I think things are
actually fine: you're just testing out a function that you shouldn't be
running on the PythonWin interactive prompt.
A different module you can play with is the 'math' module:
Good luck!
Tutor maillist - Tutor (AT) python (DOT) org