Create rename-cards.py
This commit is contained in:
parent
e5bda3b424
commit
ff170787e4
15
rename-cards.py
Normal file
15
rename-cards.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import asyncio
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
async def main(argv):
|
||||||
|
card_dir = input(f'What is the full Windows path to the card directory? ')
|
||||||
|
|
||||||
|
for x in os.listdir(card_dir):
|
||||||
|
old_name = f'{card_dir}/{x}'
|
||||||
|
new_name = f'{card_dir}/{x.split("[")[0].lower().replace("_","-").replace(" ","-")}.png'
|
||||||
|
os.rename(old_name, new_name)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
asyncio.run(main(sys.argv[1:]))
|
||||||
Loading…
Reference in New Issue
Block a user