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