FAQ - WARRExploration/Rover_II GitHub Wiki

How to make a python script executable with rosrun?

You will have to make the file executable chmod +x <path/to/file.py> and you will have to add #!/usr/bin/env python in the first line of the script (so that the os knows with what program it has to execute this file

https://askubuntu.com/questions/716280/why-do-some-python-scripts-begin-with-usr-bin-env-python/716281