Commits

Anonymous committed 02a304b

renameext: (NEW) CLI Tool to rename lots of files and their extensions

Comments (0)

Files changed (1)

+#!/usr/bin/env python
+
+import sys
+from os import rename
+from os.path import splitext
+
+
+ext = sys.argv[1]
+files = sys.argv[2:]
+
+for file in files:
+    old = splitext(file)
+    new = (old[0], ext,)
+    rename("".join(old), "".join(new))