![]() ![]() The cursor object is used for the functioning of the SQLite functions. ![]() In this above code, we are defining the function database where we are creating the “connectn” object to connect the database “contactdata.db” of sqlite. Code for database and table creation # For creating the database and the tableĬonnectn = nnect("contactdata.db")Ĭursor.execute("CREATE TABLE IF NOT EXISTS `contactinformation` (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, first_name TEXT, middle_name TEXT, last_name TEXT, gender TEXT, age TEXT, home_address TEXT, phone_number TEXT)")Ĭursor.execute("SELECT * FROM `contactinformation` ORDER BY `last_name` ASC") In this code, the reset function is used for clearing the value you put in the text entry of adding new contacts. Output: Resetting the values in the system #Function for resetting the values If yes it will close the GUI else if no then it will return back to the main display of the contact management system in python. In the above code, we are defining the exit function where the user is about to take some action to which, the user is to answer yes or no. O = ("Contact Management System", "Do you want to exit the system") Code for exit function of a system #Function for exiting the system Here we are declaring the variables to accept the values in the string format while filling in the details. Declaring the variables for the contact management system python program # Variables required for storing the values Tkinter.ttk – To create the tree where all the information will be displayed. ![]() ssagebox – To show a display box, displaying some information or an error or warningĦ. SQLite3 – To connect the program to the database and store information in it.ģ. These modules are used for the following purposes:Ģ. The import function includes these modules in the project Code flow: Contact Management System in python with source code Importing the libraries #Importing the modules Note: You can install the modules by going to “File”->” Settings”-> ” Project: New Contact Management”->” Python Interpreter”->click on the” +” sign and write the name of the module want to install. Write the code in the file and execute the Python Program for the contact management system by Clicking the Run tab P圜harm Setup3 in Contact management system P圜harm Setup2 in Contact management system project in PythonĤ. Right-click on the project name you have created and Create a New Python File as “ contactmanage.py”. P圜harm Setup1 in Contact management system in Pythonģ. Create New Project by clicking on File and selecting New Project, writing the project name, and clicking on “ Create”.First Install Pycharm Community Edition 2021.3.1 (community edition is to be installed).Exit the System Use of Pycharm IDE for Project The basic task to be performed on this Project are:ĥ. This is a GUI-based program in python that basically includes the use of the Tkinter and Sqlite3 database for the execution. Summary Project Overview: Contact Management System Python Project Project Name:Ĭontact Management System Project in Python.Complete Source code of contact management system in Python.Code for creating a table in the contact management system window.Code for updating the contacts in the system.Module for frame, labels, text entry, and button for adding new contact form window.Insert Query for inserting into the database.Code for inserting contacts in the system.Declaring the variables for the contact management system python program.Code flow: Contact Management System in python with source code.Project Overview: Contact Management System Python Project.About Contact Management System in Python.If update_contact(contacts, name, phone, email): Next, we load the contacts from the CSV file using the load_csv function and display a menu with options to add, search, update, and delete contacts. ![]() With open("contacts.csv", "a", newline="") as file:ĭef update_contact(contacts, name, phone, email): With open("contacts.csv", newline="") as file: With open("contacts.csv", "w", newline="") as file: Here, we define functions to create a new CSV file with a header row, load the CSV file into a list of dictionaries, add a new contact to the CSV file, search for a contact by name, update an existing contact, and delete a contact. Next, we define several functions – create_csv, load_csv, add_contact, search_contact, update_contact, and delete_contact. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |