Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Copy a file in python
- shutil.copyfile(sys.argv[0],path)
- #Clear a file in python
- history = open(os.path.join(home,f),”w”))
- history.seek(0)
- history.truncate()
- history.close()
- #Check if a file has been updated in python
- while True:
- if stamp != os.stat(log).st_mtime:
- stamp = os.stat(log).st_mtime
- #Check if the path is a file
- os.path.isfile(fname)
- #Check if the path exists
- os.path.exists(file_path)
Add Comment
Please, Sign In to add comment