Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- # open_tempfile.py
- import os
- import tempfile
- abc='''
- This is a basic demo
- which should create a
- temporary file then
- open Notepad to show
- this data as written.
- '''
- srcfilename = tempfile.mktemp(".txt", "demo")
- temp = open(srcfilename, 'w')
- temp.write(abc)
- temp.close()
- os.system("notepad.exe "+srcfilename)
- print srcfilename
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement