O'Reilly logo

Learning Python Network Programming by Sam Washington, Dr. M. O. Faruque Sarker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Flask – a microframework

To get a taste of working with a Python web framework, we're going to write a small app with Flask. We've chosen Flask because it provides a lean interface, giving us the features we need while getting out of the way and letting us code. Also, it doesn't require any significant preconfiguration, all we need to do is install it, like this:

>>> pip install flask
Downloading/unpacking flask

Flask can also be downloaded from the project's homepage at http://flask.pocoo.org. Note that to run Flask under Python 3, you will need Python 3.3 or higher.

Now create a project directory, and within the directory create a text file called tinyflaskapp.py. Our app is going to allow us to browse the docstrings for the Python built-in functions. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required