Skip to main content

Posts

Showing posts from April, 2022

create tab in python tkinter

 Here in this blog we are going to create tab in tkinter ========================================================================== from tkinter import * from tkinter import ttk root = Tk () s = ttk . Style () s . configure ( "TNotebook.Tab" , font =( "times new roman" , "14" , "bold" )) tabControl = ttk . Notebook ( root ) tab1 = Frame ( tabControl ) tab2 = Frame ( tabControl ) tabControl . add ( tab1 , text = "entry with listbox" ) tabControl . add ( tab2 , text = "database entry" ) tabControl . pack () root . mainloop ()

Auto list with entry box and database and even the concatenation of data

 Here in this blog, we are having some objectives which you will see here pointwise create Tkinter then create two tabs  in a second tab, I have created a database entry system and I have also concatenated the two databases into one. And after that we have called the concatenated item in the list box and then automated the Listbox ==========================================================================                                                                                      ======================================================================== And here is the following code from tkinter import * import sqlite3 from tkinter import ttk root = Tk () root . geometry ( "400x500" ) root . title ( "auto society" ) conn = sqlite3 . connect ( "society...

Add data into sqlite database

 Here in this blog we are going to discuss about the `adding of the data into the database system. So this is the procedure to do so ========================================================================= from tkinter import * import sqlite3 from tkinter import ttk root = Tk () root . geometry ( "400x500" ) root . title ( "auto society" ) conn = sqlite3 . connect ( "society_sample.db" ) c = conn . cursor () # create table c . execute (     """CREATE TABLE IF NOT EXISTS sample_society( code text, society text, socde text)""" ) def add ():     # create a database or connect to one     conn = sqlite3 . connect ( 'society_sample.db' )     # create cursor()     c = conn . cursor ()     # insert into table     c . execute (         "INSERT INTO sample_society VALUES(:society,:code,:socde)" ,         {             'society' : en1 . get (...

entry with listbox and database

 Here in this coding we are going to see the entry attached with listbox and database of sqlite 3 so here is the coding to as follows ======================================================================== from tkinter import * import sqlite3 root = Tk () root . title ( 'Codemy.com - Auto Select/Search' ) root . geometry ( "500x300" ) # Update the listbox def update ( data ):     # Clear the listbox     my_list . delete ( 0 , END )     # Add toppings to listbox     for item in data :         my_list . insert ( END , item ) # Update entry box with listbox clicked def fillout ( e ):     # Delete whatever is in the entry box     my_entry . delete ( 0 , END )     # Add clicked list item to entry box     my_entry . insert ( 0 , my_list . get ( ANCHOR ))     my_list . forget ()#here forget will work because re-entry can be done by deleting     the items....

entry box with the automatic listbox

 Here in this coding we are going to show the entry connected with the listbox in python. so here is the following coding as respective to the needs. ========================================================================= import tkinter as tk def on_change (* args ):     # print(args)     value = var_text . get ()     value = value . strip (). lower ()     # get data from test_list     if value == '' :         data = test_list     else :         data = []         for item in test_list :             if value in item . lower ():                 data . append ( item )                 # update data in listbox     listbox_update ( data ) def listbox_update ( data ):     # delete previous data     listbox . delete...