Skip to content

Instantly share code, notes, and snippets.

@parnexcodes
Last active April 14, 2022 14:14
Show Gist options
  • Save parnexcodes/fe9d9e452d944375c26e52e07f817e25 to your computer and use it in GitHub Desktop.
Save parnexcodes/fe9d9e452d944375c26e52e07f817e25 to your computer and use it in GitHub Desktop.
import os
import glob
list1 = []
for file in glob.glob("*.sup"):
print(file)
list1.append(file)
list2 = []
for j in list1:
first_temp = j.index(",")+2
first_remove = j[first_temp:]
second_temp = first_remove.index(",")
second_remove = first_remove[:second_temp]
list2.append(second_remove)
for i in range(len(list1)):
os.system(f'ren "{list1[i]}" "{++i}({list2[i]}).sup"')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment