Skip to content

Instantly share code, notes, and snippets.

@kathysll
Created November 7, 2019 15:23
Show Gist options
  • Save kathysll/6230f39d6c024c45417ace814fb1afc7 to your computer and use it in GitHub Desktop.
Save kathysll/6230f39d6c024c45417ace814fb1afc7 to your computer and use it in GitHub Desktop.
import os
os.chdir(r"\\tank3\production\Boresight\project\GV1825A_N977GV_D20190604_A\tif_old\test")
for f in os.listdir():
f_name, f_ext=os.path.splitext(f)
f_name = f_name.strip()[1:]
f_ext = str(".tif")
new_name = "{}{}".format(f_name,f_ext)
os.rename(f,new_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment