Python command line?

Gerhard Häring gerhard at bigfoot.de
Tue Jun 4 12:25:14 EDT 2002


In article <B9224E06.628B%sarmstrong13 at mac.com>, SA wrote:
> Hi Everyone-
> 
> I would like to run python code line by line using:
> 
> python -c some line of code
> 
> Will this work?

You need to put your code into quotes, like in:

    python -c "print 5"

Code spanning multiple lines will also work, just be sure to use ' instead of "
in your code.

Gerhard



More information about the Python-list mailing list