-1

So, I wanted to get into flask, I installed it with:

pip3 install flask

I did not get any errors, Im following a tutorial, when I go to my command line ( im on linux ) I go to the directory and do:

python3.6

import index.py

The program turns on then almost immediaitly off. Code:

from flask import Flask
app = Flask(__name__)

@app.route('/')
def result():
    return "hi"


if __name__ == '__main__':
   app.run(debug = True)
davidism
  • 121,510
  • 29
  • 395
  • 339
asdwd wdad
  • 67
  • 4
  • 7

1 Answers1

0

If you want to start your server using __name__ == "__main__", you can do it by python index.py.

davidism
  • 121,510
  • 29
  • 395
  • 339
M.Szlendak
  • 26
  • 1