🐍Always place app.run() in the if statement as displayed below in your app.py file:
if __name__ == '__main__':
app.run(port=5000, debug=True)
This helps in case you import app.py from another file. In that case, you don't want to run the app.run() function. With this 'if' statement, it will only run if app.py is directly run.
if __name__ == '__main__':
app.run(port=5000, debug=True)
This helps in case you import app.py from another file. In that case, you don't want to run the app.run() function. With this 'if' statement, it will only run if app.py is directly run.
Comments
Post a Comment