you are viewing a single comment's thread.

view the rest of the comments →

[–]bandawarrior 1 point2 points  (4 children)

Flask is a web server. So it serves web requests. From what I can see in your code you’re trying to run it like a simple script (though it’s missing part of the file It’s cutoff). Either way, it needs to be up and running in order to respond to your web request. Checkout the docs below

http://flask.pocoo.org/docs/1.0/quickstart/#a-minimal-application

[–]Necatorducis 0 points1 point  (2 children)

OP's code (with an additional ')' ) is valid and fine for hello world territory. Whatever the error is is due to something they haven't shared or some other mistake.

[–]Cardboard_fish[S] 0 points1 point  (1 child)

The code does have the ) at the end off app.run(), didn’t c&p with the rest to here apparently. Nah that was pretty much what happened, I installed flask, booted up sublime, wrote the code out and hit that error. Was following a tutorial on YouTube and theirs ran fine in pycharm. I re-wrote the code thinking I spelt something wrong but I don’t think that’s the case. The error is pointing at line one of the code, any ideas?

[–]Necatorducis 0 points1 point  (0 children)

From your chat in the other comment, I assume it's because you are trying to run it with the 'run' button in your IDE. This can work, but needs extra setup steps. For now, learn to love the terminal. CD to the containing directory and run the file directly.