Anssi Saari 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 "", line 1
pass
^
SyntaxError: invalid syntax
$ python2.5 -c ' pass'
File "", line 1
pass
^
Ben Finney 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 the OP g
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,
bear
pradeep 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 Python.
> An
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 Jos
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