Advertisement
rfmonk

shutil_copytree.py

Jan 28th, 2014
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. #!/usr/bin/env python
  2. #
  3. """
  4. BEFORE:
  5. ls: cannot access /tmp/example: No such file or directory
  6. Traceback (most recent call last):
  7. File "shutil_copytree.py", line 9, in <module>
  8. copytree('../shutil', '/tmp/example')
  9. File "/usr/lib/python2.7/shutil.py", line 171, in copytree
  10. names = os.listdir(src)
  11. OSError: [Errno 2] No such file or directory: '../shutil'
  12. """
  13.  
  14. from shutil import *
  15. from commands import *
  16.  
  17. print 'BEFORE:'
  18. print getoutput('ls -rlast /tmp/example')
  19. copytree('../shutil', '/tmp/example')
  20. print '\nAFTER:'
  21. print getoutput('ls -rlast /tmp/example')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement