We Recommend

Learning Python Learning Python
The authors of Learning Python show you enough essentials of the Python scripting language to enable you to begin solving problems right away, then reveal more powerful aspects of the language one at a time. This approach is sure to appeal to programmers and system administrators who have urgent problems and a preference for learning by semi-guided experimentation.


Posted By

qrist0ph on 05/13/08


Tagged

fileSystemCheatSheet cheatSheet


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

qrist0ph


Python Filesystem Cheat Sheet


Published in: Python 


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

Report this snippet 

You need to login to post a comment.