Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

ctypes run as administrator

import ctypes
import sys
def admin():
    try: return ctypes.windll.shell32.IsUserAnAdmin()
    except Exception: return False
if not admin(): # If not ran as administrator, re-run it as administrator!
    ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, " ".join(sys.argv), None, 1)
    sys.exit()
Comment

PREVIOUS NEXT
Code Example
Python :: update tensorflow pip 
Python :: save numpy arrayw with PIL 
Python :: install re package python 
Python :: if type is string python 
Python :: python virtual environment 
Python :: open image from link python 
Python :: how to download file from python 
Python :: tensorflow load h5 model 
Python :: python 2 decimal places 
Python :: find all nan columns pandas 
Python :: comment dériver une classe python 
Python :: python regex numbers only 
Python :: dictionary with numbers python 
Python :: datetime not defined python 
Python :: pretty print list python 
Python :: portscan with python 
Python :: remove unicode characters from string python 
Python :: celsius to fahrenheit in python 
Python :: python print file 
Python :: console clear python 
Python :: get files in directory python 
Python :: python sleep milliseconds 
Python :: how to print a random part of a list in python 
Python :: file exist python 
Python :: pyton read text file 
Python :: tkinter maximum window size 
Python :: set window size tkinter 
Python :: python print code 
Python :: python check operating system 
Python :: docker python 3.8 ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =