我正在将Atom IDE
与script
包一起使用,以在python中运行A flask应用程序。我的文件夹如下所示:
- my_flask_app.py
- css/
- main.css
- templates/
- base.html
- index.html
...
因此,如果my_flask_app.py
是我在运行时在编辑器中打开的文件,则一切正常。但是,如果此index.html
是编辑器中当前打开的文件,它将仅尝试运行文件本身而不是flask应用程序。我该怎么办,所以无论当前打开的文件是什么,它将始终运行python文件?编辑:作为对@ ali-beyit的响应,这是我输入的Configure Run Options:这是我得到的输出:
'"python my_flask_app.py"' is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.033s]
因为python my_flask_app.py
不是命令,所以不起作用。假定它已显示在PATH python
中,则应使用environment variable作为命令来工作。然后,您将文件名my_flask_app.py
作为命令参数。