build_make custom extension and default is txt

This commit is contained in:
minoplhy 2021-11-05 20:56:12 +07:00
parent ca16382abc
commit ab076e13bc
Signed by: minoplhy
GPG Key ID: 90667A59A9908AEC

View File

@ -2,12 +2,12 @@ import os
import glob
import shutil
def filepath_mass_changer(Version ,path ,apapath):
def filepath_mass_changer(Version ,path ,apapath, extension="txt"):
f = glob.glob(os.path.join(path,"*.txt"))
for filename in f:
s = os.path.basename(filename)
os.rename(filename, os.path.join(path, Version + '_' + s ))
f = glob.glob(os.path.join(path,"*.txt"))
f = glob.glob(os.path.join(path,"*."+extension))
for filename in f:
s = os.path.basename(filename)
shutil.copy2(os.path.join(path,s), apapath)