我编写了一个脚本,使我能够运行脚本然后获得我想要的输出,我正在尝试将输出写入 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
Run Code Online (Sandbox Code Playgroud)
关于如何生成 html 页面的任何想法,我可以在其中打印运行此脚本的结果?