开发者

Problem with cgi-bin python program putting output in wrong place

I have a cgi python program which runs an os.system command and this command is printing output and cau开发者_开发知识库sing havoc. How do I get python to run the os.system command and have that command print to the webpage it is being run on?


Do you have to use os.system? I would use

stdout, stderr = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr.PIPE).communicate()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜