Search code examples
pythonblock

how can i fix expected indented block on cmd


I'm trying to run hello.py under CMD but when I run the flask I get this error below, how can I fix it?

enter image description here


Solution

  • You simply need to indent the return 'Hello World!' line in your hello.py file.

    from flask import *
    app = Flask(__name__)
    
    @app.route('/')
    def hello_world():
        return 'Hello, World!'
    

    Should at least allow it to compile