Created
September 7, 2015 19:42
-
-
Save zhrkvl/e97a79124659604a9a86 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import os | |
| import os.path | |
| import random | |
| from os.path import join | |
| inDir = r'C:\kek' | |
| if(input('Input dir is: {}\nIs it correct?(y/n):'.format(inDir)) == 'n'): | |
| inDir = input('So, write input dir path:') | |
| random.seed() | |
| def f(curPath = inDir): | |
| for f in os.listdir(curPath): | |
| if(os.path.isfile( join(curPath, f) ) and f[-4:] == '.mp3'): | |
| # os.rename(join(curPath, f), join(curPath, str(random(0, 1024)) + ' ' + f)) | |
| print('rename {}'.format(join(curPath, f), join(curPath, str(random.random(0, 1024)) + f))) | |
| elif(os.path.isdir( join(curPath, f) )): | |
| f( join(curPath, f) ) | |
| f() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment