这是我的代码。
from flask import Flask
app=Flask(__name__)
@app.route('/')
def home():
return "WebApp"
if __name__=="__main__":
app.run(debug=True)
这是我遇到的错误。
Traceback (most recent call last):
File "F:/Python Projects/webapp1.py", line 7, in <module>
app.run(debug=True)
File "C:\Program Files\Python36\lib\site-packages\flask\app.py", line 938, in run
cli.show_server_banner(self.env, self.debug, self.name, False)
File "C:\Program Files\Python36\lib\site-packages\flask\cli.py", line 629, in show_server_banner
click.echo(message)
File "C:\Program Files\Python36\lib\site-packages\click\utils.py", line 218, in echo
file = _default_text_stdout()
File "C:\Program Files\Python36\lib\site-packages\click\_compat.py", line 675, in func
rv = wrapper_func()
File "C:\Program Files\Python36\lib\site-packages\click\_compat.py", line 436, in get_text_stdout
rv = _get_windows_console_stream(sys.stdout, encoding, errors)
File "C:\Program Files\Python36\lib\site-packages\click\_winconsole.py", line 295, in _get_windows_console_stream
func = _stream_factories.get(f.fileno())
io.UnsupportedOperation: fileno
我是Flask的新手,目前对此知识很少。感谢您的回答!