Robi, Z open () nie działa z pythonem 2.6
Próbuję użyć "Z open ()" z pythonem 2.6 i podaje błąd (błąd składniowy), podczas gdy działa poprawnie z pythonem 2.7.3 Czy brakuje mi czegoś lub importu, aby mój program działał!
Każda pomoc byłaby doceniana.
Br
Mój kod jest tutaj:
def compare_some_text_of_a_file(self, exportfileTransferFolder, exportfileCheckFilesFolder) :
flag = 0
error = ""
with open("check_files/"+exportfileCheckFilesFolder+".txt") as f1,open("transfer-out/"+exportfileTransferFolder) as f2:
if f1.read().strip() in f2.read():
print ""
else:
flag = 1
error = exportfileCheckFilesFolder
error = "Data of file " + error + " do not match with exported data\n"
if flag == 1:
raise AssertionError(error)