[Tutor] Running Python from UNIX

alan.gauld@bt.com alan.gauld@bt.com
Wed, 7 Aug 2002 15:14:12 +0100


First, please use plain text when posting to public 
mailing lists. Even in Outlook your purple against 
blue was very hard to read! If you make it hard to 
read theres a greater chance it won't get read. 
And that means a reduced chance of you getting 
an answer!


> I wanted to run a single line script from the command line. 
> I typed from the UNIX command prompt  
> $ python -c print 'Hello World'  

You need to enclose the entire command in quotes:

$ python -c "print 'hello world'"

HTH,

Alan g.
Author of the 'Learning to Program' web site
http://www.freenetpages.co.uk/hp/alan.gauld