mirror of
https://github.com/JonasunderscoreJones/turbo-octo-potato.git
synced 2025-10-24 10:39:19 +02:00
19 lines
604 B
Python
19 lines
604 B
Python
import os
|
|
|
|
# Define the folder where you want to remove "-min" from filenames
|
|
folder_path = "."
|
|
|
|
# Iterate through all files in the folder
|
|
for filename in os.listdir(folder_path):
|
|
if "-min" in filename:
|
|
# Generate the new filename by removing "-min"
|
|
new_filename = filename.replace("-min", "")
|
|
|
|
# Create the full path to the old and new files
|
|
old_file_path = os.path.join(folder_path, filename)
|
|
new_file_path = os.path.join(folder_path, new_filename)
|
|
|
|
# Rename the file
|
|
os.rename(old_file_path, new_file_path)
|
|
|
|
print("File renaming complete.")
|