Guest User

Untitled

a guest
Feb 17th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #Copy a file in python
  2. shutil.copyfile(sys.argv[0],path)
  3.  
  4. #Clear a file in python
  5. history = open(os.path.join(home,f),”w”))
  6. history.seek(0)
  7. history.truncate()
  8. history.close()
  9.  
  10. #Check if a file has been updated in python
  11. while True:
  12. if stamp != os.stat(log).st_mtime:
  13. stamp = os.stat(log).st_mtime
  14.  
  15. #Check if the path is a file
  16. os.path.isfile(fname)
  17. #Check if the path exists
  18. os.path.exists(file_path)
Add Comment
Please, Sign In to add comment