Skip to main content

Posts

Showing posts with the label database projects

How to Connect SQLite With Python - Step By Step Guide

  How to Connect SQLite With Python - Step By Step Guide In this tutorial, we will be learning about SQLite database and how to connect it with python for the development of database applications. SQLite as the name says, it's a simple, single file database. There is no need of downloading and installing additional files. SQLite comes packed with most python installations. From version 2.5.x onward the SQLite module comes along as a default module. Importing SQLite Module: import sqlite3 Creating a database in SQLite is very simple as if we create a a directory or a file. Database in SQLite is created during the connection phase. Database will be stored as a file in the specified directory.  Now, let's connect to our database: Create a Database and make a connection: import sqlite3 con = sqlite3 . connect ( 'mydata.db' ) From the above code block, we can see that, the connect method is provided with a parameter  'mydata.db' .  This is what our database name is...