May-27-2020, 04:58 PM
I get the following error code: NameError: name 'tempfile' is not defined
printText =Label(root, text="hello") print(printText) filename = tempfile.mktemp(".txt") open(filename, "w").write(printText) # Bellow is call to print text from your_widget_name textbox win32api.ShellExecute(0,"printto", filename, '"%s"' % win32print.GetDefaultPrinter(), ".", 0)