SHARE
TWEET

Untitled

a guest Feb 17th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top