Apache 如何对python cgi脚本进行多个异步调用

Apache 如何对python cgi脚本进行多个异步调用,apache,python-3.x,cgi,Apache,Python 3.x,Cgi,我有一个CGI表单,它接受CSV表单和电子邮件,并调用在后台运行的两个单独的python脚本。执行这些操作大约需要15分钟。我想对这些脚本进行异步调用,以便显示一些消息并防止apache超时 这是我的密码 import os import cgi, cgitb import csv import sys import subprocess import io cgitb.enable() form = cgi.FieldStorage() filedata = form['file'] fil

我有一个CGI表单,它接受CSV表单和电子邮件,并调用在后台运行的两个单独的python脚本。执行这些操作大约需要15分钟。我想对这些脚本进行异步调用,以便显示一些消息并防止apache超时

这是我的密码

import os
import cgi, cgitb
import csv
import sys
import subprocess
import io

cgitb.enable()
form = cgi.FieldStorage()
filedata = form['file']
filecontent = filedata.file.read().splitlines()
email=form.getvalue('email_address')

email = str(email)



subprocess.Popen([sys.executable, 'giw.py', str(email)], shell=False,
stdin=None, stdout=None, stderr=None, close_fds=True)


subprocess.Popen([sys.executable, 'mailer.py', str(email)], shell=False,
stdin=None, stdout=None, stderr=None, close_fds=True)
这对我很有用:-

import subprocess
import sys

subprocess.Popen([sys.executable, 'giw.py', str(email)],  stdout=subprocess.PIPE, stderr=subprocess.STDOUT);