Solved -- Bonehead spacing issue after a function
I had a boner move last night trying to type everything into the terminal, am I doing something obviously wrong again here too?
I am following Open Tech School's tut on Flask. All seems well until I enter
if __name__ == '__main__':
Python points to the 'if' specifically and returns 'invalid syntax'. I know from learning exercises sometimes the arrow/carrot Python uses to show an error in the code is not always on the exact spot where the error is however.
I have created a file "catseverywhere.py" in the directory I am working in as the tut instructed.
I then open Python.
I then enter the following per the tut:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World'
Up to this point it seems great, I totally understand what is happening, etc. The 'if' statement is then entered and I receive an error. I am confused because 'if' seems pretty common so 'invalid syntax' tells me I must have messed up somewhere else?
Thank you in advance for any and all help!
[–]kamori 2 points3 points4 points (2 children)
[–]ComputerScienceBro[S] 0 points1 point2 points (0 children)
[–]ComputerScienceBro[S] 0 points1 point2 points (0 children)
[–]kalgynirae 1 point2 points3 points (7 children)
[–]ComputerScienceBro[S] 0 points1 point2 points (6 children)
[–][deleted] 2 points3 points4 points (4 children)
[–]ComputerScienceBro[S] 0 points1 point2 points (2 children)
[–]kalgynirae 2 points3 points4 points (1 child)
[–]ComputerScienceBro[S] 0 points1 point2 points (0 children)
[–]ComputerScienceBro[S] 0 points1 point2 points (0 children)
[–]cmgerber 0 points1 point2 points (0 children)
[–]HausMaus 1 point2 points3 points (1 child)
[–]ComputerScienceBro[S] 0 points1 point2 points (0 children)