Skip to Content
Head First Python, 3rd Edition
book

Head First Python, 3rd Edition

by Paul Barry
August 2023
Beginner
666 pages
15h 44m
English
O'Reilly Media, Inc.
Content preview from Head First Python, 3rd Edition

Chapter 13. List Comprehensions: Database Integrations

Image

With your database tables ready, it’s time to integrate.

Your webapp can gain the flexibility the Coach requires by using the datasets in your database tables, and in this chapter you create a module of utilities that lets your webapp exploit your database engine. And, in a never-ending quest to do more with less code, you’ll learn how to read and write list comprehensions, which are a genuine Python superpower. You’ll also reuse a lot of your pre-existing code in new and interesting ways, so let’s get going. There’s lots of integration work to do.

Image

We’re looking forward to that, too.

To help us get there, the Head First Coders, concerned that our SQL skills might be a bit rusty, have sent over a file of SQL queries for you to consider using with your webapp.

The Coders suggested you’ll need to do a bit of extra work to use these queries to tackle Task #3 and #4, but they think the queries will help extract the data your webapp needs.

Recall the next two tasks, then take a look at the queries (copied from queries.py) on the next page.

  • Images Extract the data you need from your database tables.

    At the moment, your webapp’s code ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Head First Python, 2nd Edition

Head First Python, 2nd Edition

Paul Barry

Publisher Resources

ISBN: 9781492051282Errata Page