Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- path = os.path.join(os.getenv('HOME'), 'dirname')
- filename = os.path.join(path, 'file')
- if not os.path.exists(path):
- os.mkdir(path)
- # do what is needed to create the file in path
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement