Ask Your Question

KevinH's profile - activity

2019-04-08 01:11:37 -0500 marked best answer python syntax error for rosrun .py script

Hello I'm a noob at python, I downloaded this github package (turtlesim_hunter) Then when I rosrun I get a syntax error:

knives@knives:~/catkin_ws/src/turtlesim_hunter/src/turtlesim_hunt/Scripts$ rosrun turtlesim_hunt hunt.py
  File "/home/knives/catkin_ws/src/turtlesim_hunter/src/turtlesim_hunt/Scripts/hunt.py", line 151
    print "Found #" + str(huntedTurtles) + " after " + str(finalTime) + " Current Avg: " + str(totalHuntTime / huntedTurtles)
                  ^
SyntaxError: invalid syntax

The issue is at line 151 in the hunt.py script:

https://github.com/tiedyedguy/turtles...

print "Found #" + str(huntedTurtles) + " after " + str(finalTime) + " Current Avg: " + str(totalHuntTime / huntedTurtles)

I don't know whats wrong and I can't google myself to a specific answer, is the issue that this was written with python 3 and I only have python 2.7 installed? I highly doubt this guy has an error in his code since it's working for him:

https://www.youtube.com/watch?v=LywSO...

2018-09-21 23:39:03 -0500 received badge  Famous Question (source)
2018-09-21 23:39:03 -0500 received badge  Notable Question (source)
2018-01-24 15:41:00 -0500 received badge  Famous Question (source)
2018-01-08 10:33:05 -0500 received badge  Popular Question (source)
2018-01-08 08:22:57 -0500 edited question DIY Robot with full documentation beginner friendly suggestions for very low budget

DIY Robot with full documentation beginner friendly suggestions for very low budget I'm looking for a project to do for

2018-01-08 06:07:19 -0500 asked a question DIY Robot with full documentation beginner friendly suggestions for very low budget

DIY Robot with full documentation beginner friendly suggestions for very low budget I'm looking for a project to do for

2018-01-01 09:52:15 -0500 received badge  Notable Question (source)
2017-12-30 21:56:44 -0500 received badge  Popular Question (source)
2017-12-30 11:12:25 -0500 asked a question python syntax error for rosrun .py script

python syntax error for rosrun .py script Hello I'm a noob at python, I downloaded this github package (turtlesim_hunter