Skip to content

Instantly share code, notes, and snippets.

@dayitv89
Last active April 2, 2018 02:09
Show Gist options
  • Save dayitv89/d11069be04aa1eda1193ab34884b2786 to your computer and use it in GitHub Desktop.
Save dayitv89/d11069be04aa1eda1193ab34884b2786 to your computer and use it in GitHub Desktop.
Python script to rename all files in folder
import os
# convert all image like `<Any_name>_2x.png` to `<Any_name>@2x.png`
[os.rename(f, f.replace('_2x', '@2x')) for f in os.listdir('.') if not f.startswith('.')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment