Topic: Clueless Novice

Hello everyone,

Being as green as the man who invented the the word green, i wonder if you could point me in the right direction please.

I have installed the latest python 3.2.2, and the open source book A byte of python.

Unfortunately i am falling at the first hurdle, the test program Hello World., i believe i have entered it correctly in a new window in the IDLE editor, saving as helloworld.py as the book suggests, but get syntax errors when trying to run.

As follows:

#!usr/bin/python

#Filename: helloworld.py

print('Hello World')


The output should be:


$ python helloworld.py

Hello World


Attempting to run this in either python command line or IDLE shell returns errors. Is it me or the book?

Thanks in anticipation.

~Darren~

Thumbs up

Re: Clueless Novice

open IDLE and write there print('Hello')
open the python console and write there print('Hello')
if you are on windows, you have to configure the PATH variable in properties of "My Computer" - the path to python dir should be there
you can test it by running cmd.exe and write "python"
if it runs, then you can run scripts in such manner you wrote
if it doesn't run, then you can run scripts only by double clicking on them - they will run and close quickly
you can put input() in the end of script - it's not the best way

Thumbs up

Re: Clueless Novice

Typo in your shebang line. You've written '#!usr/bin/python'  while it should be #!/usr/bin/python.

Thumbs up