Posts

Showing posts from June, 2023

CRUD Operations using Tkinter

CRUD Operations using Tkinter from tkinter import * from pymongo import MongoClient client = MongoClient('localhost', 27017) db = client['mydatabase'] collection = db['students'] def insert():     name = name_entry.get()     email = email_entry.get()     phone = phone_entry.get()     collection.insert_one({'name': name, 'email': email, 'phone': phone})     print('Data inserted successfully') def update():     name = name_entry.get()     email = email_entry.get()     phone = phone_entry.get()     collection.update_one({'name': name}, {'$set': {'email': email, 'phone': phone}})     print('Data updated successfully') def delete():     name = name_entry.get()     collection.delete_one({'name': name})     print('Data deleted successfully') def read(): ...