From the course: Using SQL with Python

Unlock the full course today

Join today to access over 23,300 courses taught by industry experts.

Challenge

Challenge

(bright music) - [Narrator] The challenge for this chapter is to manage a simple table of domain names and descriptions. For this purpose, I've created a starting place so you can focus on the practical database parts and you'll use the crud library for this challenge. So here we have zero to challenge dot P Y from chapter two of the exercise files. And you notice I import the BW DB class from the module, and I have a number of functions here. So I'm going to just close that and open the structure. And we can look at the functions, we'll start with main. So it main does is it calls connect, which connects to the database, just like that. Very simple. And it stores the database handle in this globals and this globals is just a handy little dictionary for keeping a few global variables. I may just have that one. I don't know. It's a way that I've done this in Python for years and years. It's a…

Contents