Home  >  Q&A  >  body text

flask - 很简单的几句python代码,为什么直接Process finished with exit code 2呢?

直接运行就这样了

前几天还可以的..不知道怎么突然就不行了.

求熟手帮忙看看原因.

大家讲道理大家讲道理2743 days ago980

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-04-17 14:40:37

    flask-script To use this plug-in, enter

    in the command line
    python hello.py runserver
    

    Use the pycharm function of run and just execute python hello.py without adding the runserver parameter. Therefore the script is executed without parameters.

    The solution is to use the drop-down arrow of the run option, select the edit configure option, and then add it in script parameters

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 14:40:37

    No parameters are added when running

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 14:40:37

    Already in the prompt

    usage: hello.py [-?] {runserver, shell} ...
    

    Try it

    python.exe D:\...\hello.py runserver
    

    Or change the last line of code to

    app.run()
    

    reply
    0
  • Cancelreply