O'Reilly logo

MySQL for Python by Albert Lukaszewski, PhD

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

Project: A command-line insertion utility

We can now put together the elements of database programming that we have covered in this chapter to form a robust command-line insertion utility. For this project we want to create a program with the following functionality:

  • Runs from the command-line
  • Uses a flag system allowing for the -h flag for help
  • Allows the user to define the database being used
  • Allows the user to designate which user and password combination to use
  • Allows the user to ask for the tables available in a given database
  • Provides the user with the column structure of the table on demand
  • Validates user input for the given table of the selected database
  • Builds the database INSERT statement on-the-fly
  • Inserts the user input into the chosen table ...

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