开发者

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

开发者 https://www.devze.com 2023-01-04 01:14 出处:网络
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 comma

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

精彩评论

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