can't run simple program in terminal
A raw python recruit, I used the IDLE facility in Ubuntu and got the window with the info at the top telling me which version etc, followed by the python prompt. Since I couldn't seem to delete the info about the Python version, I just typed the print instruction thus:
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> print "Where am I?"
Where am I?
>>>
I saved this as hello.py in a folder I called My_Python, went back to the terminal window, changed to the directory where I'd put the program and then typed the command to run, thus:
brian@ubuntu:
the response I got was:
File "./hello.py", line 1
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
^
SyntaxError: invalid syntax
It looks as if I need to get rid of the stuff that's not proper code (i.e. the Python 2.7.3 etc).
How do I do this?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Brian Renshaw
- Solved:
- Last query:
- Last reply: