SHOW:
|
|
- or go back to the newest paste.
1 | - | #!/usr/bin/env python |
1 | + | #!/usr/bin/env python |
2 | - | |
2 | + | # Not a very good example, using slice notation seemed the best bet |
3 | - | |
3 | + | # but i'm thinking a regex could have cleaned all the various extensions |
4 | - | import os |
4 | + | # so I didn't have to keep modifying the code depending on extension |
5 | - | import glob |
5 | + | # will revisit this topic |
6 | - | |
6 | + | |
7 | - | os.chdir('/home/rfmonk/Source') |
7 | + | import os |
8 | - | |
8 | + | import glob |
9 | - | for fi in glob.glob("*.h-*"): |
9 | + | |
10 | os.chdir('/home/rfmonk/Source') | |
11 | ||
12 | for fi in glob.glob("*.c-*"): | |
13 | os.rename(fi, fi[:-13]) |