If this is just a shell command that needs to be run requesting elevated privileges, you can do this:
os.system("""osascript -e 'do shell script "<commands go here>" " with administrator privileges'""")
It will run a shell command in the applescript interpreter and ask the user for its credentials; effectively running the command with sudo.
Please note that it will be fun to reset quotes in your command, for example
os.system("""osascript -e 'do shell script "mkdir -m 0775 -p \\"%s\\" " with administrator privileges'"""%d)
Hope this helps!
source share