- 702 名前:名無しさん@お腹いっぱい。 mailto:sage [2008/07/21(月) 16:36:16 ID:2FA16e5j0]
- >>698
意味(><; ) わかんないんです!プログラムかけない奴は死ねば? ということで書いてみた。オプションには未対応です>< md5_rename_6432cb1823a9fa328c413b592787bc8c.pyみたいなファイル名になる。 from sys import argv from shutil import move, copy import md5, os filePath = argv[1] rnFilePath = list(os.path.split(filePath)) fileMd5 = md5.new(open(filePath, 'rb').read()).hexdigest() extInx = rnFilePath[-1].rfind('.') rnFilePath[-1] = rnFilePath[-1][:extInx]+'_'+fileMd5+rnFilePath[-1][extInx:] rnFilePath = '\\'.join(rnFilePath) copy(filePath, rnFilePath)
|

|