pyth0n2
December 27th, 2014, 01:08 PM
Hi there Ubuntuforums community.
I have a random beginner question in regards to running python scripts.
I guess some quick context is in order. I've been doing the Codecademy and Computer Science Circles courses online. So no need for an editor so far.
However today I decided to read some other articles aswell. When I tried to follow one of these articles lessons that involved creating and running a simple script, it all fell apart.
You know when you open up IDLE, and it greets you with the text:
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "copyright", "credits" or "license()" for more information.
Well, when I make a simple script containing only:
Print ("Hello World")
and then save it to my Desktop as script.py and run it. I receive the following error:
File "script.py", line 1
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
^
SyntaxError: invalid syntax
Its saving the copyright information as part of the script and then running it!
I have tried googling this issue, and searching the forums, however I am at a loss as to how to put this into into keywords for a search, so Ive turned up nothing.
Can anyone shed some light on the (probably embarrasingly simple) mistake I am making?
Thanks in advance guys.
P.S. If this is worded too poorly let me know and i'll attempt to rephrase it. I've done my best though.
I have a random beginner question in regards to running python scripts.
I guess some quick context is in order. I've been doing the Codecademy and Computer Science Circles courses online. So no need for an editor so far.
However today I decided to read some other articles aswell. When I tried to follow one of these articles lessons that involved creating and running a simple script, it all fell apart.
You know when you open up IDLE, and it greets you with the text:
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "copyright", "credits" or "license()" for more information.
Well, when I make a simple script containing only:
Print ("Hello World")
and then save it to my Desktop as script.py and run it. I receive the following error:
File "script.py", line 1
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
^
SyntaxError: invalid syntax
Its saving the copyright information as part of the script and then running it!
I have tried googling this issue, and searching the forums, however I am at a loss as to how to put this into into keywords for a search, so Ive turned up nothing.
Can anyone shed some light on the (probably embarrasingly simple) mistake I am making?
Thanks in advance guys.
P.S. If this is worded too poorly let me know and i'll attempt to rephrase it. I've done my best though.