Python 2.x and 3.x usage survey

Steve Hayes hayesstw at telkomsa.net
Wed Jan 1 12:55:23 EST 2014


On Thu, 2 Jan 2014 01:07:54 +1100, David <bouncingcats at gmail.com> wrote:

>On 1 January 2014 23:38, Steve Hayes <hayesstw at telkomsa.net> wrote:
>>
>> I was thinking or of this:
>>
>>>>> python g:\work\module1.py
>>   File "<stdin>", line 1
>>     python g:\work\module1.py
>>            ^
>>
>> Which gave a different error the previous time I did it.
>>
>> But, hey, it worked from the DOS prompt
>>
>> C:\Python32>python g:\work\module1.py
>> Hello Module World
>
>Your windows command shell prompt looks like this: "C:\Python32>"
>It indicates that windows shell is waiting for you to type something.
>It expects the first word you type to be an executable command. If you
>do this:
>  C:\Python32>python g:\work\module1.py
>it tells the shell to run the python interpreter and feed it all the
>python statments contained in the file g:\work\module1.py
>
>If you do this:
>  C:\Python32>python
>it tells the shell to run the python interpreter interactively, and
>wait for you to directly type python statements. When the python
>intepreter is ready for you to type a python statement, it gives you a
>">>>" prompt. It expects you to type a valid python language
>statement.
>
>The reason this gave an error:
>>>> python g:\work\module1.py
>
>is because you are using the python interpreter as shown by ">>>", but
>you typed a windows shell command, not a python statement.

Thank you. Back to the book!


-- 
Steve Hayes from Tshwane, South Africa
Web:  http://www.khanya.org.za/stevesig.htm
Blog: http://khanya.wordpress.com
E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk



More information about the Python-list mailing list