0

I got this script

import os

shutdown = input("Do you wish to shutdown your computer ? (yes / no): ")
if shutdown == 'no':
  exit()
else:
  os.system("shutdown /s /t 1")

and when I run it and enter yes it says "shutdown: NOT super-user"

Pranav Hosangadi
  • 23,755
  • 7
  • 44
  • 70
  • 2
    Does this answer your question? [shutting down computer (linux) using python](https://stackoverflow.com/questions/23013274/shutting-down-computer-linux-using-python) – Gino Mempin Apr 27 '22 at 23:39

1 Answers1

0
  os.system("sudo shutdown /s /t 1")

Enter sudo

Yes
  • 1