4
I have a machine on which Python 2.6.6 is installed, in a certain part of a script I do the following command:
with open('saida1.txt') as saida:
for line in saida:
if "]L" in saida:
print line
In which I seek the string "]L" in the output file1.txt and print the corresponding line.
Running the same script with the same command on another machine with Python 2.4.3 displays syntax error in the "open command".
Could you tell me if this is because of a version or a compiler or something? Or if there is another way to make the same resource?
Error:
$ python teste.py
File "teste.py", line 1
with open('saida1.txt') as saida:
^
SyntaxError: invalid syntax
Adds full traceback error
– Adriano Martins