Value In Brief
All You Need To Know Explained In Brief

How to Shutdown your PC using Python ?

Python scripting languages Tutorials

If you want to shutdown your Windows PC from your Python code, just use this code snippet.

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

That’s it. I hope this helps. Do you recommend reading this blog post? share it!