defcopyAppScanTemplate(target_file, target_url):
with open("G:\\appScanTemplate\\alpha\\alpha-cloud.scan", 'r') as f_read:
file_read=f_read.readlines()
replace_str= "https://alpha-cloud.yunshicloud.com/"
for line infile_read:
with open(target_file,"a+") as f_write:if replace_str inline:
new_line=line.replace(replace_str, target_url)
f_write.write(new_line)else:
f_write.write(str.encode(line))defstartcp():
with open("G:\\appScanTemplate\\alpha\\domain.txt", 'r+') as fr:
file_read=fr.readlines()
count=0for line infile_read:
target_url= "https://{}/" .format(line.strip('\n').strip())
target_file= "G:\\appScanTemplate\\alpha\\" + line.split('.')[0] + ".scan"copyAppScanTemplate(target_file, target_url)
count+= 1
print(count)
if __name__ == "__main__":
startcp()