Спросите привилегию Sudo от Python в MacOS
os.system("""osascript -e 'do shell script "<commands go here>" " with administrator privileges'""")
Clear Cow
os.system("""osascript -e 'do shell script "<commands go here>" " with administrator privileges'""")