Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在将python flask中的响应{html page}返回给用户后在后台运行/激活服务/函数_Python_Rest_Flask - Fatal编程技术网

如何在将python flask中的响应{html page}返回给用户后在后台运行/激活服务/函数

如何在将python flask中的响应{html page}返回给用户后在后台运行/激活服务/函数,python,rest,flask,Python,Rest,Flask,我正在做一个从html到a.py的POST请求。 然后进行一些计算并通过传递一些参数进行函数调用f1()。 此函数位于另一个文件(如B.py)中 要做: 调用f1()后,我想将a.py的响应返回给一个可以是html页面的用户 但是B.py中的f1()函数应该在后台运行,并且它的逻辑不会返回任何内容 A.py,因为它有自己的退出/结束逻辑 感谢您的帮助。谢谢 我尝试了这些解决方案,但没有任何效果: (一) 2) 烧瓶反应 (三) 下面是代码片段 #A.py from B import * @app

我正在做一个从html到a.py的POST请求。 然后进行一些计算并通过传递一些参数进行函数调用f1()。 此函数位于另一个文件(如B.py)中

要做:

调用f1()后,我想将a.py的响应返回给一个可以是html页面的用户

但是B.py中的f1()函数应该在后台运行,并且它的逻辑不会返回任何内容 A.py,因为它有自己的退出/结束逻辑

感谢您的帮助。谢谢

我尝试了这些解决方案,但没有任何效果:

(一) 2) 烧瓶反应 (三)

下面是代码片段

#A.py
from B import *
@app.route("/abc",methods=["POST"])
def hello_there():
temp_list={}
for x,y in request.args.items():
temp_list[x]=y
set_temp_list(temp_list) #This function is present in B.py
m1() #This function is in B.py which will activate some service running in background which will run 
#untill 30 minutes after calling .
return render_template("Thankyou.html")