Advertisement
rfmonk

Working_remove_pastbin_junk2.py

Jan 22nd, 2014
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2. # Not a very good example, using slice notation seemed the best bet
  3. # but i'm thinking a regex could have cleaned all the various extensions
  4. # so I didn't have to keep modifying the code depending on extension
  5. # will revisit this topic
  6.  
  7. import os
  8. import glob
  9.  
  10. os.chdir('/home/rfmonk/Source')
  11.  
  12. for fi in glob.glob("*.c-*"):
  13.     os.rename(fi, fi[:-13])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement