我如何修复cmd上预期的缩进块

问题描述 投票:-3回答:1

我正在尝试在CMD下运行hello.py,但是当我运行烧瓶时,我在下面收到此错误,我该如何解决?

enter image description here

python block
1个回答
0
投票

您只需要在return 'Hello World!'文件中缩进hello.py行。

from flask import *
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'

至少应该允许它编译

© www.soinside.com 2019 - 2024. All rights reserved.