Search code examples
pythonflaskprologswi-prolog

Call a backend function from flask web app getting access violation for file open function


I have a flask function which is like below. When I trigger this via an html, the function named (function_to_be_called) does not work properly cause it uses a library (prolog) which opens a file (prolog config file).

I am getting OSError: exception: access violation reading 0x0000000000000050

When I call this function directly, without the web interface everything is ok.

I need help in executing the function and getting the results. Kind Regards, Ferda

@app.route("/execute_scenario/", methods=["GET", "POST"])

def executeScenario():
    form = IndexForm(request.form)
    input1 = "something"
    input2 = 5678
    function_to_be_called(inpt1, input2)
 return redirect(url_for("home"))

Solution

  • I switched to PrologMQI. Now the problem is solved.