diff options
author | kinitrupti | 2017-05-12 18:40:35 +0530 |
---|---|---|
committer | kinitrupti | 2017-05-12 18:40:35 +0530 |
commit | 64d949698432e05f2a372d9edc859c5b9df1f438 (patch) | |
tree | 012fd5b4ac9102cdcf5bc56305e49d6714fa5951 /pythonscript.py~ | |
parent | 9c6ab8cbf3e1a84c780386abf4852d84cdd32d56 (diff) | |
download | Python-Textbook-Companions-64d949698432e05f2a372d9edc859c5b9df1f438.tar.gz Python-Textbook-Companions-64d949698432e05f2a372d9edc859c5b9df1f438.tar.bz2 Python-Textbook-Companions-64d949698432e05f2a372d9edc859c5b9df1f438.zip |
Revised list of TBCs
Diffstat (limited to 'pythonscript.py~')
-rw-r--r-- | pythonscript.py~ | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pythonscript.py~ b/pythonscript.py~ new file mode 100644 index 00000000..14400f5a --- /dev/null +++ b/pythonscript.py~ @@ -0,0 +1,20 @@ + +import os,sys + +rootdir = os.getcwd() + + +for path,dirname,files in os.walk(rootdir): + for file in files: + if file.endswith(".ipynb"): + filename = file.split('.') + version = filename[0].rsplit('_') + print version + if len(version)>1: + try: + int(version[-1]) + file_new = file + except ValueError: + file_new = file.replace('_'+version[-1],'') + + os.rename(os.path.join(path,file),os.path.join(path,file_new))
\ No newline at end of file |