Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

shutdown/restart windows with python

# This is for a windows operating system
# We will use the os library
import os

# os.system is basically running a cmd command

os.system("shutdown /s") #shutdown
os.system("shutdown /r") #restart
os.system("shutdown /l") #logoff
os.system("shutdown /h") #hibernate

#for a full list of commands, go into Command Prompt and type "shutdown"
Comment

PREVIOUS NEXT
Code Example
Python :: pandas replace column name spaces with underscore 
Python :: how to get image in jupyter notebook 
Python :: check python version mac 
Python :: get diroctary in python 
Python :: python click on screen 
Python :: rgb to grayscale python opencv 
Python :: python delete saved image 
Python :: python - prime number generator 
Python :: track phone number location using python 
Python :: object to int64 pandas 
Python :: select categorical columns pandas 
Python :: django import Q 
Python :: how to make downloadable file in flask 
Python :: split array into chunks python 
Python :: python random hex color 
Python :: python windows hide files 
Python :: python download image from url 
Python :: convert column string to int pandas 
Python :: how to get size of folder python 
Python :: beuatiful soup find a href 
Python :: how to increase the figure size in matplotlib 
Python :: plt.savefig df.plot 
Python :: pip code for pytube 
Python :: selenium python enter text 
Python :: how copy and create same conda environment 
Python :: how ot split a string every fourth eter 
Python :: matplotlib x label rotation 
Python :: Python - How to check if string is a HEX Color Code 
Python :: discord.py clear command 
Python :: python os if file exists 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =