Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #oh mY GOD IT EVEN HAS AN EDITING FUNCTION SARAH UR TOO GOOD LVL UP
- import os, tempfile, subprocess
- def get_rand_filename(dir_=os.getcwd()):
- "Function returns a non-existent random filename."
- return tempfile.mkstemp('.tmp', '', dir_)[1]
- def open_with_notepad(s):
- "Function gets a string and shows it on notepad"
- with open(get_rand_filename(), 'w') as f:
- f.write(s)
- subprocess.Popen(['notepad', f.name])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement