I am building a Web App in which the user should put some numbers , and server will calculate some functions and generates some plots. Calculation and Plotting happens in a separate module (*.py file). Now the problem is integrating them together.
lets say my Calculations happens in calculate.py and plotting.py ,
so I have to import them as :
import calculate
import plotting
depending on what user gives me as an input , I have to calculate and plot , so in the beginning I define a function for doing so
def calculation(a,b)
#do something and
#save the plots
#and give me the result
and then my flask :
app = Flask(__name__)
if __name__ == '__main__':
app.run(debug=True,port=8080)
calculation(a,b)
but calculation function, never runs . Flask however runs properly and can also render my other html pages , but the calculation function never gets to run.
what seems to be the problem ? Moreover, I found out that print() function also doesnt work when flask app is initiated.