Why the file with flask project should be run from the command line?

Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
Just starting to learn the micro framework Flask.
Wrote this code to test:
from flask import Flask app = Flask(__name__) @app.route('/') def home(): return 'hello, World' # if __name__ == '__main__': # app.run() app.run()

If I open this file in IDLE and press F5, the error will fall.
If I do this the file will run it via cmd, then everything is fine.
by | 36 views

1 Answer

0 like 0 dislike
Most likely in the IDLE environment is not configured.

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
asked May 3, 2019 by genana40
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
40,796 users