Is it possible to run a function in Python before the PC shuts down? Or lets say while it is shutting down?
Maybe using os module, or something else.
So let's say I have this function and I want to run it while PC is shutting down:
def onShutDown():
# lets say send an email
BTW: I know how to send an email with smtplib so that is not the problem here.
Thank you!