Re: syntax error : first python program

2009-12-23 Thread Bearophile
Ben Finney: bash# /usr/bin/python sample.py   File sample.py, line 2     name = blah     ^ SyntaxError: invalid syntax Indentation is syntax in Python. But I agree, a little better error message may help there, something that contains indentation in it :-) Bye, bearophile --

Re: syntax error : first python program

2009-12-23 Thread Anssi Saari
Ben Finney ben+pyt...@benfinney.id.au writes: bash# /usr/bin/python sample.py File sample.py, line 2 name = blah ^ SyntaxError: invalid syntax Indentation is syntax in Python. At least here with Python 2.5.2 I get IndentationError: unexpected indent. I'm just wondering why would

Re: syntax error : first python program

2009-12-23 Thread Ben Finney
Anssi Saari a...@sci.fi writes: At least here with Python 2.5.2 I get IndentationError: unexpected indent. I'm just wondering why would the OP get a SyntaxError? $ python2.4 -c ' pass' File string, line 1 pass ^ SyntaxError: invalid syntax $ python2.5 -c ' pass' File string, line

syntax error : first python program

2009-12-22 Thread pradeep
I have this file in linux === sample.py #!/usr/bin/env python name = blah print name --- I executed this bash# ./sample.py File ./sample.py, line 2 name = blah ^ bash# /usr/bin/python sample.py File sample.py, line 2

Re: syntax error : first python program

2009-12-22 Thread Erik Max Francis
pradeep wrote: I have this file in linux === sample.py #!/usr/bin/env python name = blah print name ... Any one knows , whats the syntax error here? You're indenting for no reason. -- Erik Max Francis m...@alcyone.com http://www.alcyone.com/max/ San Jose,

Re: syntax error : first python program

2009-12-22 Thread Ben Finney
pradeep bansal.prad...@gmail.com writes: #!/usr/bin/env python name = blah print name These two lines are indented, but are not inside a block. bash# /usr/bin/python sample.py File sample.py, line 2 name = blah ^ SyntaxError: invalid syntax Indentation is syntax in