im completely new to python and not particularly experienced with anything that isnt running off of a web server...

Im reading 'A byte of Python' and while my first shell script worked, which was just the 'Hello world', but if I create a separate file and have saved it within the python31 directory which was created when I installed python onto my pc... the book says that if I set the first line of the separate file to

#!/usr/bin/python

and then in the shell just type

python helloworld.py

it will run... but it doesnt...

where do i save files?
what should i set as the path to the interpreter?

thanks

Recommended Answers

All 2 Replies

Member Avatar for sravan953

You can type whatever code you want and just save it as "<whatever>.py" and that's it! It should work even if you double-click it!

What does your file helloworld.py look like?

Also the shebang line #!/usr/bin/python only works with the Linux/Unix OS.

Don't run your Python programs from the shell, use an IDE editor, see:
http://www.daniweb.com/forums/post104834.html#post104834

The shell is for short tests of mostly one line code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.