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

The requests module

Requests was written to make HTTP requests very simple and human-readable. In simple terms, it lets us visit a web address directly in Python code instead of having to use a browser. This also gives us back the data returned from the server, meaning we can make use of it in our Python code.

We can use requests to grab data back from our flask web service and use it in some Python code. We will begin with a small demo script which will make use of the data which is being returned from our index function.

First things first; we need to install the requests module via pip. Make sure your virtual environment is sourced and run  pip install requests in your command line.

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