Add inputrename.py.
This commit is contained in:
parent
a8c78acbdc
commit
b0ae28b7a3
1 changed files with 14 additions and 0 deletions
14
inputrename.py
Normal file
14
inputrename.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from voussoirkit import winglob
|
||||||
|
|
||||||
|
keyword = sys.argv[1]
|
||||||
|
pattern = f'*{keyword}*'
|
||||||
|
|
||||||
|
files = winglob.glob(pattern)
|
||||||
|
for file in files:
|
||||||
|
print(file)
|
||||||
|
this = input('>')
|
||||||
|
if this:
|
||||||
|
os.rename(file, file.replace(keyword, this))
|
Loading…
Reference in a new issue