-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQRcode.py
45 lines (31 loc) · 1.3 KB
/
QRcode.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import tkinter as tk
from tkinter import filedialog
import pyqrcode
from pyqrcode import QRCode
from PIL import Image,ImageTk
def QRCODE():
url = Enter_URL.get()
if url:
QR_url = pyqrcode.create(url)
File_Address = filedialog.asksaveasfilename(defaultextension=".svg", filetypes=[("SVG dosyaları", "*.svg")])
if File_Address:
with open(File_Address, 'wb') as f: # Open the file in binary write mode
QR_url.svg(f, scale=8)
Ans_TAG.config(text="QRCODE IS SUCCESSFULLY CREATED!!")
App_Window = tk.Tk()
App_Window.title("QR_Code Maker")
Enter_TAG = tk.Label(App_Window,text="Enter URL :")
Enter_URL = tk.Entry(App_Window,width=40)
QR_CODE_Create_BTN = tk.Button(App_Window,text="Create QRCODE",command=QRCODE)
Ans_TAG = tk.Label(App_Window,text="")
Image_path = "Scan_me.jpg"
Img = Image.open(Image_path)
Img = Img.resize((100,100))
photo = ImageTk.PhotoImage(Img)
Image_label = tk.Label(App_Window,image=photo)
Enter_TAG.grid(row=0,column=0,padx=10,pady=10)
Enter_URL.grid(row=0,column=1,padx=10,pady=10)
QR_CODE_Create_BTN.grid(row=1,column=0,columnspan=2,padx=10,pady=10)
Ans_TAG.grid(row=2,column=0,columnspan=2,padx=10,pady=10)
Image_label.grid(row=1, column=0)
App_Window.mainloop()