Python SQLite Tutorial
Selected Reading
- Python SQLite - Discussion
- Python SQLite - Useful Resources
- Python SQLite - Quick Guide
- Python SQLite - Cursor Object
- Python SQLite - Join
- Python SQLite - Limit
- Python SQLite - Drop Table
- Python SQLite - Delete Data
- Python SQLite - Update Table
- Python SQLite - Order By
- Python SQLite - Where Clause
- Python SQLite - Select Data
- Python SQLite - Insert Data
- Python SQLite - Create Table
- Python SQLite - Establishing Connection
- Python SQLite - Introduction
- Python SQLite - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Python SQLite - Establishing Connection
Python SQLite - Estabpshing Connection
To estabpsh connection with SQLite Open command prompt, browse through the location of where you have installed SQLite and just execute the command sqpte3 as shown below −
Estabpshing Connection Using Python
You can communicate with SQLite2 database using the SQLite3 python module. To do so, first of all you need to estabpsh a connection (create a connection object).
To estabpsh a connection with SQLite3 database using python you need to −
Import the sqpte3 module using the import statement.
The connect() method accepts the name of the database you need to connect with as a parameter and, returns a Connection object.
Example
import sqpte3 conn = sqpte3.connect( example.db )
Output
print("Connection estabpshed ..........")Advertisements