我写了一个脚本,使我能够运行脚本并得到我想要的输出,我正在尝试将输出写入html页面,我该怎么做?这是我的脚本:
def execute(cmd):
os.system(cmd)
to_return =dict()
for filename in files:
with open(filename, 'r') as f:
data = f.read()
to_return[filename] = data
return to_return
output = execute('./script')
print output
有没有想法如何生成一个HTML页面,以便我可以打印运行此脚本的结果?