the windows interpreter

Jim Richardson warlock at eskimo.com
Sun Jun 11 22:41:54 EDT 2000


On Mon, 5 Jun 2000 15:23:06 +0200, 
 Tim Gahnström, in the persona of <md9tim at mdstud.chalmers.se>,
 brought forth the following words...:

>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
>


The syntax is massively incorrect, please read the tutorial, it is very 
helpful and will cover this pretty early on. 

-- 
Jim Richardson
	Anarchist, pagan and proud of it
WWW.eskimo.com/~warlock
	Linux, because life's too short for a buggy OS.




More information about the Python-list mailing list