Invalid syntax on hello world program

Discussion in 'Python' started by ianb, Mar 11, 2011.

  1. ianb

    ianb

    Joined:
    Mar 11, 2011
    Messages:
    1
    Hi, i'm just starting to learn python obviously and trying to get this program to run and it comes back as invalid syntax.

    Python 2.6.

    Print 'hello world' works fine, but i wrote the following program in text wrangler

    #!/usr/bin/python
    # Filename : helloworld.py
    print 'Hello World'

    then opened up a terminal and typed python helloworld.py and it comes back as invalid syntax.

    I'm a right beginner at all this but i've tried numerous different ways of writing it with brackets, quotes, double quotes, spaces etc., and i cant' get anything to work... nor can i seem to find a definitive answer in my search on what python 2.6 syntax is.

    So basically i feel stuck with no being able to continue working through the guide until i can get this program working. Any help be great.
     
    ianb, Mar 11, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vijay
    Replies:
    8
    Views:
    722
  2. Roy
    Replies:
    6
    Views:
    634
    Roedy Green
    Jan 7, 2008
  3. Henrik Bechmann

    Invalid syntax with print "Hello World"

    Henrik Bechmann, Mar 12, 2009, in forum: Python
    Replies:
    10
    Views:
    31,542
    bob gailer
    Nov 14, 2013
  4. Dr DOOM
    Replies:
    2
    Views:
    152
    Dr DOOM
    Aug 10, 2003
  5. Larry
    Replies:
    27
    Views:
    434
    Michele Dondi
    Jan 25, 2005
Loading...

Share This Page