Created
March 19, 2019 08:31
-
-
Save ZhigangPu/c1ec5e8d429630a321042c03990dbc3b to your computer and use it in GitHub Desktop.
change file name from png to jpg
This file contains hidden or 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
import os | |
for filenames in os.listdir(): | |
if filenames.endwith('png'): | |
os.rename(filename, filename[:-3]+'jpg') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment