[Tutor] Syntax error
richard kappler
richkappler at gmail.com
Thu Jan 7 13:08:04 EST 2016
Hi Sarah!
instead of 'python hello.py', try
>>>import hello.py
using python hello.py works from the Linux command line (presumably Windows
as well) and it starts python then runs the hello.py script. From within
the python interpreter, you import the file and it executes.
HTH, Richard
On Thu, Jan 7, 2016 at 1:01 PM, Joel Goldstick <joel.goldstick at gmail.com>
wrote:
> On Thu, Jan 7, 2016 at 8:40 AM, Sarah Rasco <sarah.a.rasco at gmail.com>
> wrote:
>
> > Hello,
> >
> > I'm new to programming and was told that Python would be a good language
> to
> > start with. I downloaded version 3.5.1, and I have Windows 10.
> >
> > In IDLE, I typed print ("Hello, world!") and hit enter, and it returned
> the
> > message. I saved the file as hello.py in C:\python. Then, when I tried to
> > run it in IDLE, I got a syntax error and it highlighted the '5' in the
> > prompt 'python 3.5.1'.
> >
> > I also tried to run it in my windows command prompt. I put in cd
> C:\python
> > and it gave me the python prompt. Then, when I tried to open the file by
> > typing python hello.py, I was given a syntax error again. Does anyone
> have
> > any suggestions as to what the problem could be?
> >
> > Thank you!
> > _______________________________________________
> > Tutor maillist - Tutor at python.org
> > To unsubscribe or change subscription options:
> > https://mail.python.org/mailman/listinfo/tutor
> >
>
> Welcome Sarah.
>
> Can you copy and paste the traceback (error message) that you get when you
> run your code. Also, copy and paste your complete code text.
>
> --
> Joel Goldstick
> http://joelgoldstick.com/stats/birthdays
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
--
All internal models of the world are approximate. ~ Sebastian Thrun
More information about the Tutor
mailing list