All pastes #421566 Raw Edit

Cody Brocious

public python v1 · immutable
·published 2007-04-02 22:04 UTC
rendered paste body
import ctypes, sysGetCommandLineW = ctypes.windll.kernel32.GetCommandLineWGetCommandLineW.restype = ctypes.c_wchar_pargs = GetCommandLineW()numArgs = ctypes.c_int(0)CommandLineToArgvW = ctypes.windll.shell32.CommandLineToArgvWres = CommandLineToArgvW(args, ctypes.byref(numArgs))args = (ctypes.c_wchar_p * numArgs.value).from_address(res)sys.argv = []for arg in args[1:]:	sys.argv.append(arg)