'How to fix "shutdown: NOT super-user" when using a shutdown script in Python? [duplicate]

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"



Solution 1:[1]

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

Enter sudo

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yes