Last active
February 1, 2018 17:11
-
-
Save psidex/4add8ebd1c7d53cce0372e6c65268226 to your computer and use it in GitHub Desktop.
This file contains 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
from tkinter import Tk, filedialog | |
import os | |
Tk().withdraw() | |
directory = filedialog.askdirectory() | |
filenames = os.listdir(directory) | |
for count, filename in enumerate(filenames): | |
file_extension = os.path.splitext(filename)[1] | |
print(filename + " -> " + str(count+1)+file_extension) | |
os.rename(os.path.join(directory, filename), os.path.join(directory, str(count+1)+file_extension)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment