Skip to content

Instantly share code, notes, and snippets.

@pranshuj73
Created December 11, 2021 17:14
Show Gist options
  • Save pranshuj73/78eb001f49e1a42cd46a51728080647e to your computer and use it in GitHub Desktop.
Save pranshuj73/78eb001f49e1a42cd46a51728080647e to your computer and use it in GitHub Desktop.
replacing extensions in file names
import os
files = os.listdir()
for file in files:
if '_11zon' in file:
print(file)
os.rename(file, file.replace('_11zon', ''))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment