Похожие чаты

My code is doing mostly a generation of xml based

on a template , but I want to print every new filename after generate is executed , but I think I code it in the wrong way. how can I make work to print every filename after generation?
def generate(self):
import os
try:
filepath = "./common"
with open (os.path.join(filepath, randomString(8)+".xml"), "w") as a:
for path, subdirs, files in os.walk(filepath):
for filename in files:
f = os.path.join(path, filename)
template = open('./templates/build.xml','r')
template = template.read()
template = template.replace("STRING",randomString(8))
a.write(template)
ReturnSuccess("Generated stager successfully")
ReturnInfo("Launch with {f}")
except Exception as e:
print("Could not generate directory listing file.")

1 ответов

9 просмотров

print(filename) after template = template.replace("STRING",randomString(8))

Похожие вопросы

Обсуждают сегодня

Карта сайта