I'm attempting to execute foo.py from mysite.com/foo.py, however the script requires access to directories that would normally require sudo -i root access first. chmod u+s foo.py still doesn't give the script enough permission. What can I do so the script has root access? Thank you!
Have you tried chmod 777 foo.py or chmod +x foo.py? Those are generally the commands used to give  file permission to run.
CGI: Execute python script as root