the windows interpreter
Tim Gahnström
md9tim at mdstud.chalmers.se
Mon Jun 5 09:23:06 EDT 2000
I downloaded and installed the python 1.5 for windows interpreter.
I can use some pyton comands at the prompt like
>>> print "Hi"
will causet the output
Hi
I can also create simple files with idle and run them with F5.
But when I try to use an example program like
----
#! /usr/local/bin/python
import sys
if '-h' in sys.argv or '--help' in
sys.argv or '--help' in sys.argv: print '''
help.py--does nothing useful (yet)
options: -h, -help, or --help-display this help
Copyright (c) Jacek Artymiak, 2000 '''
sys.exit(0)
else:
print 'I don't recognize this option' sys.exit(0)
---
Then it will not work at al, not even if I remove
the first "linux inspired" line
I get the errormessage
----
Traceback (innermost last):
File "F:\pyton\Python\Tools\idle\ScriptBinding.py", line 131, in
run_module_event
execfile(filename, mod.__dict__)
File "F:\pyton\Python\test.py", line 3
if '-h' in sys.argv or '--help' in
^
SyntaxError: invalid syntax
---
I would apreciate if anyone had a suggestion.
Tim Gahnström
More information about the Python-list
mailing list