def check_sudo():
 check = None
 if (not subprocess.mswindows):
  if getattr(os, 'geteuid'):
   check = (os.geteuid() == 0)
 else:
  import ctypes
  check = ctypes.windll.shell32.IsUserAnAdmin()
 return check

def check_sudo ( ) : check = None if ( not subprocess . mswindows ) : if getattr ( os , 'geteuid' ) : check = ( os . geteuid ( ) == 0 ) else : import ctypes check = ctypes . windll . shell32 . IsUserAnAdmin ( ) return check
checks for sudo/administrator privileges .