小编use*_*657的帖子

从IPython运行Flask引发了SystemExit

我正在尝试从IPython运行我的Flask应用程序.但是,它失败并出现SystemExit错误.

from flask import Flask

app = Flask(__name__)

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

if __name__ == '__main__':
   app.run(debug=True)
Run Code Online (Sandbox Code Playgroud)

使用IPython运行它会显示以下错误:

SystemExit                                Traceback (most recent call last)
<ipython-input-35-bfd7690b11d8> in <module>()
     17 
     18 if __name__ == '__main__':
---> 19    app.run(debug = True)

/Users/ravinderbhatia/anaconda/lib/python2.7/site-packages/flask/app.pyc in run(self, host, port, debug, **options)
    770         options.setdefault('use_debugger', self.debug)
    771         try:
--> 772             run_simple(host, port, self, **options)
    773         finally:
    774             # reset the first request information if the development server

/Users/ravinderbhatia/anaconda/lib/python2.7/site-packages/werkzeug/serving.py in run_simple(hostname, port, application, use_reloader, use_debugger, …
Run Code Online (Sandbox Code Playgroud)

python ipython flask jupyter

4
推荐指数
1
解决办法
4696
查看次数

标签 统计

flask ×1

ipython ×1

jupyter ×1

python ×1