如何告诉cgi停止等待
how to tell cgi to stop waiting
我在服务器端 运行 python 并且脚本会 运行 一段时间,我不想让用户等待。
有没有办法将一些 html 打印到 CGI 并告诉它停止等待更多事情发生。而脚本仍然是 运行?
CGI 不等待程序退出,几乎每次它等待 stdout 和 stderr 关闭时都会发生这种情况。
所以这就是你应该做的:
import sys
sys.stdout.close()
sys.stderr.close()
我在服务器端 运行 python 并且脚本会 运行 一段时间,我不想让用户等待。
有没有办法将一些 html 打印到 CGI 并告诉它停止等待更多事情发生。而脚本仍然是 运行?
CGI 不等待程序退出,几乎每次它等待 stdout 和 stderr 关闭时都会发生这种情况。 所以这就是你应该做的:
import sys
sys.stdout.close()
sys.stderr.close()