how to use and get admin in python 2.7

i am trying to get admin priviliges using python. where can i put my code? this is my code

import win32com.shell.shell as shell
ASADMIN = 'asadmin'

if sys.argv[-1] != ASADMIN:
    script = os.path.abspath(sys.argv[0])
    params = ' '.join([script] + sys.argv[1:] + [ASADMIN])
    shell.ShellExecuteEx(lpVerb='runas', lpFile=sys.executable, lpParameters=params)
    someFunction()
    sys.exit(0)
else:
    print "I'm elevated!"
    sys.exit(0)