Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python
- import os
- SIZE = 32
- def main():
- """ Main function, all the work goes here. """
- cnt = 0
- for name in os.listdir(os.getcwd()):
- cnt += 1
- pnt = name.rfind(".")
- ext = name[pnt:]
- new = name[:min(pnt, SIZE)]
- os.rename(name, str(cnt) + new.strip() + ext)
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement