transitland / transitland-processing-animation

Animating scheduled transit trips using the Transitland API and Processing
MIT License
279 stars 55 forks source link

SyntaxError: invalid syntax with 'print len' #5

Closed AnthonyLovesBikes closed 7 years ago

AnthonyLovesBikes commented 7 years ago

Hello, I have the following error when I run the tool as shown below - I am using Python 3.6 not sure if this is the issue? Thanks for any help, I am fairly new but very keen to try and make this work!

C:\Users\Anthony\Desktop\transitland-processing-animation-master\transitflow>python transitflow.py --name=GO --operator=o-dpz-gotransit File "transitflow.py", line 37 print len(lookup_vehicle_types.keys()), "routes found.\n" ^ SyntaxError: invalid syntax

willgeary commented 7 years ago

Thanks -- yes, this is a python 3 vs python 2 issue. Python 2 print commands look like print this vs Python 3 print commands, which look like print(this). You could fix this to work with Python 3 quite easily. More info here: http://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html

AnthonyLovesBikes commented 7 years ago

Thanks, I ran it with Python 2.7 and it worked perfectly! Result is here: https://youtu.be/g5vcUoIjTRA Thanks!

willgeary commented 7 years ago

Looks great!

Mr-Lawrence-521 commented 1 year ago

Sorry to interrupt,I am facing a similar problem: File "/public/home/guolang/software/MatchAnnot-master/matchAnnot.py", line 92 print '\nisoform: %-16s' % (clusterName) ^ SyntaxError: invalid syntax Could anyone help to solve the problem? Thanks very much!