Im currently learning to program and a friend asked me if i can write a program to shut down a pc. I used the os and keyboard module and my code is the following
import keyboard
import os
keyboard.add_hotkey('s', lambda: os.system('shutdown -s'))
The program works but he asked me if i could run it in the background is there a module for that