How to install Flask on Windows?

前端 未结 10 1193
灰色年华
灰色年华 2020-12-03 01:02

I have a project to do for after create a webpage that display the latest weather from my CSV file.

I would like some details how to do it (don\'t really get the

10条回答
  •  青春惊慌失措
    2020-12-03 02:03

    First install flask using pip,

    pip install Flask
    

    * If pip is not installed then install pip

    Then copy below program (hello.py)

    from flask import Flask
    app = Flask(__name__)
    
    @app.route("/")
    def hello():
        return "Hello World!"
    
    if __name__ == "__main__":
        app.run()
    

    Now, run the program

    python hello.py
    

    Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

    Just copy paste the above address line in your browser.

    Reference: http://flask.pocoo.org/

提交回复
热议问题