Flask Hello World-Got an invalid syntax

Hi there,
I am trying to work on my first flask programming. However, I have encountered an issue as shown in the photo. Could anyone please advise?

Very respectfully,

Hello Long, and welcome!

Posting images of text is usually not very helpful. It makes it
difficult or impossible for the blind and visually impaired, who may be
using a screen reader, or anyone reading this message in a text-only
environment or by email. If your question requires us to run your code,
we would have to re-type it from the image, possibly introducing typos
or new errors.

Please copy and paste the text of the error you are getting into the
body of your message. It may be helpful to format it as code by
indenting it by four spaces, like this:

> function(1, 2 "a")
  File "<stdin>", line 1
    function(1, 2 "a")
SyntaxError: invalid syntax

If you are getting a syntax error, as the title of your post says, have
you checked the syntax of the line for typos, missing colons or commas,
mismatched-parentheses, etc?

app.py has syntax error check app.py file inside your flask project

Hi Hasnat!

Thank you for your response. I saved app.py file from sublime as py format but the file was converted into note instead. Do you know how to save app.py into python format? Please advise!



It looks like you did not save the file. Python is reading what is saved on disk, not what you see in the editor.
Press Ctrl+S in the editor (or select File/Save in the menu) to save the file.
Look out for the “dot” on your editor’s tab – that’s an indication of unsaved changes: image

Hi Petr Viktorin,
Thank you for your response. I thought Sublime was running my code without me saving it :laughing: it worked. Thanks a lot for your helps.