代码:
from flask import Flask
app=Flask(__name__)
@app.route('/')
def hello():
return 'hello world'
if __name__=="__main__":
app.run()
输出:
Traceback (most recent call last):
File "C:/Users/master/Desktop/aa.py", line 1, in <module>
from flask import Flask
File "C:\Users\master\AppData\Local\Programs\Python\Python39\flask.py", line 2, in <module>
app=Flask(__name__)
NameError: name 'Flask' is not defined