While the Python db-api is completely functional, it is not always well-suited for a particular application. This is an example of a wrapper module that the author uses for many projects.
- [Instructor] For many purposes…the Python DB API is all you'll need.…If you're doing a significant amount of database coding,…you'll want something more robust.…Here in Komodo I've opened a working copy…of bwDB.py from chapter 15 of the exercise files.…This is a database interface that I've created…and used over many years and in several different languages.…It's not exhaustive but it provides sufficient…functionality for most uses and it's extensible.…
This interface uses SQLite which I use a lot.…I find it both powerful and convenient…and in my cases a more reliable and robust choice…than a client server system like MySQL.…So let's take a look at this interface down here…on line eight I import sqlite3 and here's my constructor,…and you'll notice that in each of my functions…I have what's called a doc string.…This is a Python paradigm I may have mentioned it before,…where if you put a string as the first line,…just a bare literal string as the first line…of any function, method, or class, that serves as…documentation for that function, method, or class.…
- Python anatomy
- Types and values
- Conditionals and operators
- Building loops
- Defining functions
- Python data structures: lists, tuples, sets, and more
- Creating classes
- Handling exceptions
- Working with strings
- File input/output (I/O)
- Creating modules
- Integrating a database with Python db-api
Skill Level Intermediate
Python: Programming Efficiently (2017)with Michele Vallisneri2h 15m Intermediate
2. Language Overview
3. Types and Values
8. Structured Data
11. String Objects
12. File I/O
13. Built-in Functions
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.