python

Keypress Event using Python

This tutorial will teach you how to use Keypress Event using Python step by step. from tkinter import * from tkinter import messagebox root = Tk() root.geometry(“300×100”) def callback(event): msg = e1.get() messagebox.showinfo(“information”, msg) Label(root, text=”Student Name”).place(x=10, y=10) e1 = Entry(root) e1.place(x=140, y=10) e1.bind(‘<Return>’,callback) root.mainloop() i attached the video link. watch this video this help

Keypress Event using Python Read More »

How to Make a Clickable Images using Python

This tutorial will teach you how to make a Clickable Images using Python. Step 1 Code from tkinter import * from tkinter import messagebox from PIL import Image, ImageTk root = Tk() canvas = Canvas(root, width=600, height=600) canvas.pack() def first(): messagebox.showinfo(‘First’,’You clicked the first image’) def second(): messagebox.showinfo(‘First’,’You clicked the second image’) def third(): messagebox.showinfo(‘First’,’You

How to Make a Clickable Images using Python Read More »

View records table using Python tkinter mysql

This tutorial will teach you how to View records using python mysql to the table. import tkinter as tk from tkinter import ttk import mysql.connector def show(): mysqldb = mysql.connector.connect(host=”localhost”, user=”root”, password=””, database=”smschool”) mycursor = mysqldb.cursor() mycursor.execute(“SELECT id,stname,course,fee FROM record”) records = mycursor.fetchall() print(records) for i, (id,stname, course,fee) in enumerate(records, start=1): listBox.insert(“”, “end”, values=(id, stname,

View records table using Python tkinter mysql Read More »

Search using python tkinter mysql

This tutorial will teach you how to search using python Gui application connect with mysql. from tkinter import * import mysql.connector def Ok(): global myresult studname = e1.get() coursename = e2.get() fee = e3.get() mysqldb=mysql.connector.connect(host=”localhost”,user=”root”,password=””,database=”smschool”) mycursor=mysqldb.cursor() try: mycursor.execute(“SELECT * FROM record where id = ‘” + studname + “‘”) myresult = mycursor.fetchall() for x in

Search using python tkinter mysql Read More »

Insert Records using Python tkinter mysql

This tutorial will teach you how Insert  the Records using Python and mysql. Establish the database connection.   from tkinter import * from tkinter import messagebox import mysql.connector def Ok(): studname = e1.get() coursename = e2.get() feee = e3.get() mysqldb=mysql.connector.connect(host=”localhost”,user=”root”,password=””,database=”smschool”) mycursor=mysqldb.cursor() try: sql = “INSERT INTO record (id,stname,course,fee) VALUES (%s, %s, %s, %s)” val =

Insert Records using Python tkinter mysql Read More »