import tempfile import win32api import win32print filename = tempfile.mktemp (".txt") open (filename, "w").write ("This is a test") wi