The Flask Installation and First program execution

2020-03-30 Shashank Dharasurkar Download Code

Hello programmers, today we are going to learn what is flask how to install it with python and how to run flask programs. So lets start.

Intro to Flask

                Flask is a micro framework for python web development. A framework, in the simple terms. it is a library or collections of libraries whose aim is to solve a part of generic problem instead of specific one. While building any web applications, there are some problems that will needed to be solved for successful execution of program. The Flask is a micro framework because it implements only core functionality but it leaves authentication and database ORMs like more advanced functionlaity.

Ok so here we stop with the theory and start with the coding part step by step.



Installing flask through pip could not be more straightforward. Simply run the following command in your terminal or command prompt.

pip install flask


After installing flask successfully you can import flask into python program just as with any other library.

First Program

So after installing flask successfully open your python in command prompt and write the following code



from flask import Flask
app = Flask(__name__)
def index():
	return "Hello World!"

if __name__ == "__main__":,debug=False)

You can get this code file named in download section of this post. After executing the above you will get the hello world  in your browser.


Note that sometimes it opens your default browser automatically or some times you have to open the running url with provided port number in your browser. (for ex. Here  I have opened the url “” because I have provided my free port number 5000)

So Here we stop for now. try this by your own. if you face any problem regarding this post feel free to comment below in comment section. To get updated with our new up coming post please subscribe to your newsletter.

Thank you…

Happy Coding…

About author

Card image cap
Shashank Dharasurkar

I’m a full-stack developer, with a fundamental knowledge of programming experience on Computer Vision and Automation like Opencv, python-Gui, python and Interested in computers and machine learning and also likes to write about it!!

-Python Developer


Scroll to Top