Posted By

qrist0ph on 05/13/08


Tagged

fileSystemCheatSheet cheatSheet


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

qrist0ph
taboularasa
carlosabargues
jasonseney
danielalexwood


Python Filesystem Cheat Sheet


 / Published in: Python
 

  1. import os
  2. import glob
  3.  
  4. # List
  5. os.listdir('c:')
  6. # oder
  7. glob.glob("c:\\*.txt"):
  8.  
  9. # Delete
  10. os.remove('C:\\Temp\\xml')
  11.  
  12. # Copy
  13. import shutil
  14. shutil.copy(src,dest)

Report this snippet  

You need to login to post a comment.