Hi,
I want to use tempfile.NamedTemporaryFile()
to write some contents into it and then open that file. I have written following code:
tf = tempfile.NamedTemporaryFile()
tfName = tf.name
tf.seek(0)
tf.write(contents)
tf.flush()
but I am unable to open this file and see its contents in notepad or similar application. Is there any way to achieve this? Why cant I do something like:
os.system('start notepad.exe ' + tfName)
at the end