Header Ads Widget

Responsive Advertisement

generate qr code using python

                                                 






########### alll images##################






#####################all function
def red():
win.configure(bg="red")
def black():
win.configure(bg="black")
def green():
win.configure(bg="green")
def color():
cl=colorchooser.askcolor()
win.configure(bg=cl[1])
def quit():
ms=messagebox.askokcancel("Notification","You want to go back")
if(ms==True):
win.destroy()
else:
empty_label.configure(text="Nice Thinking")

def gens():
a=entry_id.get()
b=entry_name.get()
c=entry_mas.get()
d=f"Youer id is: {a}\nYouer name is: {b}\nYouer message is: {c}"
url=pyqrcode.create(d)
ent=file_entry.get()
url.png(ent+".png",scale=10)
empty_label.configure(text=f"Saved file name: {ent}.png ")
clears()




def clears():
entry_id.delete(0,"end")
entry_name.delete(0,"end")
entry_mas.delete(0,"end")
file_entry.delete(0,"end")



from tkinter import*
from tkinter import messagebox
import pyqrcode

from tkinter import colorchooser
win=Tk()
win.title("Qrgenrater")
win.geometry("580x400")
win.iconbitmap('qr.ico')
win.resizable(False,False)
############################################## menu bar logo
red_icon=PhotoImage(file="red.png")
red_icon=red_icon.subsample(2,2)

black_icon=PhotoImage(file="black.png")
black_icon=black_icon.subsample(2,2)

green_icon=PhotoImage(file="green.png")
green_icon=green_icon.subsample(2,2)

###########################################menu bar
menubar=Menu(win)
colormenu=Menu(menubar,tearoff=False,background="pink")
menubar.add_cascade(label="Color Theme",menu=colormenu,compound=LEFT)
colormenu.add_command(label="Red",image=red_icon,compound=LEFT,command=red)
colormenu.add_command(label="Black",image=black_icon,compoun=LEFT,command=black)
colormenu.add_command(label="Green",image=green_icon,compound=LEFT,command=green)
colormenu.add_command(label="Color chooser",command=color)

############################################################## label

label_id=Label(text="Enter youer id: ",width=13,font=("times",25,"italic bold"),fg="red",bg="powder blue")
label_id.place(x=10,y=30)

label_name=Label(text="Enter  youer name: ",width=17,font=("times",25,"italic bold"),fg="red",bg="powder blue")
label_name.place(x=10,y=80)


label_mas=Label(text="Enter Youer messag: ",width=17,font=("times",25,"italic bold"),fg="red",bg="powder blue")
label_mas.place(x=10,y=130)

########################### file label
file_label=Label(text="file save name: ",width=12,font=("times",15,"italic bold"),fg="red",bg="powder blue")
file_label.place(x=300,y=200)


############################################ entry
entry_id=Entry(win,width=16,font=("times",20,"italic bold"),bg="pink",bd=5)
entry_id.place(x=320,y=30)


entry_name=Entry(win,width=17,font=("times",18,"italic bold"),bg="pink",bd=5)
entry_name.place(x=350,y=80)

entry_mas=Entry(win,width=17,font=("times",18,"italic bold"),bg="pink",bd=5)
entry_mas.place(x=350,y=130)

################################## file entry
file_entry=Entry(win,bg="pink",font=("time",8,"italic bold"),bd=5)
file_entry.place(x=450,y=200)



######################################################buttons logo

gen_icon=PhotoImage(file="create.png")
# gen_icon=gen_icon.subsample(2,2)

clear_icon=PhotoImage(file="rubber.png")
clear_icon=clear_icon.subsample(2,2)

quit_icon=PhotoImage(file="close.png")
quit_icon=quit_icon.subsample(2,2)


##################################################### bttons         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@



btn_gen=Button(win,text="Genrate",bg="powder blue",activebackground="purple",bd=5,width=90,font=("times",15,"bold"),image=gen_icon,compound=RIGHT,command=gens)
btn_gen.place(x=10,y=250)

btn_clear=Button(win,text="Clear",bg="powder blue",activebackground="purple",bd=5,width=70,font=("times",12,"bold"),image=clear_icon,compound=RIGHT,command=clears)
btn_clear.place(x=240,y=250)

btn_cancel=Button(win,text="Quit",bg="powder blue",activebackground="purple",bd=5,width=60,font=("times",10,"bold"),image=quit_icon,compound=RIGHT,command=quit)

btn_cancel.place(x=450,y=250)

######################################################## under label
noti_label=Label(win,text="NOTIFICATION: ",width=18,font=("times",15,"bold"),bg="powder blue",fg="red",bd=5)
noti_label.place(x=10,y=340)


empty_label=Label(win,text="",bg="powder blue",font=("times",20,"bold"),fg="green",width=18)
empty_label.place(x=270,y=340)

win.configure(menu=menubar)
win.configure(bg="blue")
win.mainloop()
                                                     

Also read: 

Aryan Khan Baril




Rahul Gandhi's open letter to farmers-labourers, warned PM Modi, do not do this 'adventure' further








kissan aandolan victory 2021 | किसान आंदोलन विक्ट्री 2021


कृषि काऩूऩ | krishi kanoon 2021














    

Post a Comment

3 Comments