I want to shut down my computer(mac) using a python script for some code I have written. I have tried the following
os.system('shutdown -s')
os.system('shutdown -h now')
But both of these produce the output 256 and my system doesn't shut down.
I read it might be due to not having root privileges but I guess I can't provide root privileges through python. Is there a way I can run a python script and shut down my mac with the above problem ?