Why the program ends with Process finished with exit code 0?

0 like 0 dislike
Good day.
Trying to learn Flask but in the beginning we were faced with a problem: the web server is not raised and the program ends with Process finished with exit code 0

class Configuration(object): EDBUG = True

app py
import sys from flask import Flask from config import Configuration app = Flask(__name__) app.config.from_object(Configuration)

from app import app from view import view if __name__ == '__main__': app.run()

from app import app from flask import render_template @app.route('/') def index(): return render_template('base.html', name='username')

<!DOCTYPE html>Title{{ name }}

Work through PyCharm, Flask hooked
by | 2.6k views

2 Answers

1 like 0 dislike
Looks like it is launching the wrong file (not main.py), you need to check that PyCharm should run the correct file in the configuration.
Run -> Edit Configuration... -> Script Path
0 like 0 dislike

How do I fix process finished with exit code 0?

That is good news! It means that there is no error with your code. You have run it right through and there is nothing wrong with it. Pycharm returns 0 when it has found no errors (plus any output you give it) and returns 1 as well as an error message when it encounters errors.


Process finished with exit code 0

You are not running it as a test but as a normal Python script.

You realize it is not part of the output right? It's just additional information provided by the IDE's console. The real program is just outputting hellow as expected.

Saying that the Process finished with exit code 0 means that everything worked ok. If an exception occurs in your program or otherwise an exit is generated with non-zero argument, the IDE is gonna inform you about this, which is useful debug information.

You're not supposed to run your Python programs from the IDE when in production so I think trying to remove that is irrelevant.

by (150 points)

Related questions

110,608 questions
257,187 answers
40,796 users