O'Reilly logo

Tkinter GUI Programming by Example by David Love

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

Our first web page

The first step is to install flask. As usual, we can install flask using pip inside a virtual environment.

Using the command line, navigate to the folder where you have been writing your chat application and enter the following commands:

python3 -m venv envsource env/bin/activatepip install flask

Pip should take care of installing flask, along with its dependencies, inside your new virtual environment.

Once this has finished, create a folder named server alongside your Python files for the previous chapter. This is where we will be placing our web service for the chat application.

Inside this folder, create a file named server.py and place the following code inside:

from flask import Flaskapp = Flask(__name__)app.config.from_object(__name__) ...

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