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
--
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
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
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
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,
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