You can get the win32 handle of a file in Python by:
file = CreateFile("C:\\\\File.txt") handle = str(msvcrt.get_osfhandle(file.fileno())) file.close()