把所有dw的shell文件都转成pw
import os
import shutil
link = './'
target = "./pw/"
for i in os.listdir(link):
if i.endswith('.sh'):
print(i)
new = i.replace("dw","pw")
print(new)
if i != new:
shutil.copy(i,new)
import os
import shutil
link = './'
target = "./pw/"
for i in os.listdir(link):
if i.endswith('.sh'):
print(i)
new = i.replace("dw","pw")
print(new)
if i != new:
shutil.copy(i,new)