I wrote a project in 2.7.9 and now have to port it to 2.4.3. I have a one-liner that is giving me syntax issues and am not sure what part of it does not comform to 2.4.3.
Code:
file = open(fileName, 'r')
header = [a for a in file.readline().split(',')]
data = [{x : y for x, y in zip(header, line.strip('\n').split(','))} for line in file]
Error: =
data = [{x : y for x, y in zip(header, line.strip('\n').split(','))} for line in file]
^
SyntaxError: invalid syntax
`