summaryrefslogtreecommitdiff
path: root/pythonscript.py~
diff options
context:
space:
mode:
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