Apr-14-2020, 08:29 PM
new to flask , i have web app that containes few parts
for example:
for example:
in utils.py
for example:
utils/ -- utils.py db/ -- oracle.py main.pyMy Question is how can i make global_response function/handler that can be called from : utils.py,oracle.py,main.py without threading problem
for example:
in utils.py
clas Utils(): def A(self): return global_response("error","a")oracle.py
clas Utils(): def ORA(self): return global_response("error ora","b")main.py
def some_fun(self): return global_response("error main","c")and here is the response function which was in main.py but now needs to be called from any where :
def global_response(error_msg, title,*options): res = {"status": error_msg, "title": title} for option in options: res.update(option) return json.dumps(res)