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()
精彩评论