[Tutor] Calling Modules in ActiveState 2.4

Bob Nienhuis bob.nienhuis at gmail.com
Thu Sep 22 01:29:56 CEST 2005


Just tried again. Got:
>>> import sys
>>> sys.exit()
Firing event 'ProcessEnter' failed.
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

sys.exit(0)
>>>

On 9/21/05, Bob Nienhuis <bob.nienhuis at gmail.com> 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
>
> Bob
>
> On 9/21/05, Damien Gouteux <damien.gouteux at gmail.com> wrote:
> >
> > For exit:
> > You need to put an argument (more input) :
> > import sys
> > sys.exit(0)
> > The argument of exit is the return value of your script (0 = okay, other
> > = problem).
> > sys.path is an attribute (of type list) of sys not a function.
> > So don't put () after path.
> > I hope it will help.
> > Damien.
> >
> > Bob Nienhuis wrote:
> >
> > Working my way through Alan Gauld's tutorial, and I am on the
> > section on modules.
> >
> > When I call:
> > import sys
> > sys.exit()
> > I get a traceback error saying it needs more input
> >
> > Same when I do:
> > import sys
> > print sys.path()
> >
> > Both of these work if I do
> > sys.exit
> > or print sys.path without the parentheses.
> > Is this new behavior in Activstate 2.4, or do I need
> > to set an environment variable?
> >
> > Bob
> >
> >
> > ------------------------------
> >
> > _______________________________________________
> > Tutor maillist  -
> > Tutor at python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050921/bf251ea5/attachment.html


More information about the Tutor mailing list