Chargement en cours README.md +7 −2 Numéro de ligne d'origine Ligne d'origine Numéro de ligne de diff Ligne de diff # objQRCode # objQRCode objQRCode est un utilitaire pour créer des QRCode écrit en python. **objQRCode** est un utilitaire pour créer des QRCode écrit en python. C'est en faite une interface graphique pour **qrcode** (https://pypi.org/project/qrcode/) sous python. L'application est en cours de développement. C'est en faite une interface graphique pour qrcode sous python. ## Paquets à installer : ## Paquets à installer : - qrcode - qrcode Chargement en cours Chargement en cours @@ -40,3 +42,6 @@ https://goqr.me/#t=wifi ### segno - python ### segno - python - https://segno.readthedocs.io/en/latest/index.html - https://segno.readthedocs.io/en/latest/index.html - https://www.freecodecamp.org/news/how-to-create-stunning-qr-codes-with-python - https://www.freecodecamp.org/news/how-to-create-stunning-qr-codes-with-python ### autres : - https://www.youtube.com/watch?v=FShKBCoGeQg&ab_channel=Apprenezlawebradio No newline at end of file main.py +87 −55 Numéro de ligne d'origine Ligne d'origine Numéro de ligne de diff Ligne de diff Chargement en cours @@ -5,20 +5,41 @@ from tkinter import * from tkinter import * from tkinter import messagebox from tkinter import messagebox from tkinter.colorchooser import askcolor from tkinter.colorchooser import askcolor from tkinter import filedialog from tk_tools import SmartSpinBox from tk_tools import SmartSpinBox import qrcode import qrcode from qrcode.constants import ERROR_CORRECT_M from qrcode.constants import ERROR_CORRECT_M import cv2 from PIL import Image from PIL import Image fg_color = "#000000" fg_color = "#000000" bg_color = "#FFFFFF" bg_color = "#FFFFFF" VERSION = 3 version = 3 curent_file = "" # ===== FONCTIONS ===== # ===== FONCTIONS ===== # ouverture d'un fichier def open_file(): global curent_file file = filedialog.askopenfilename(title="Ouvrir un QRCode au format PNG", defaultextension="png", initialdir="./qrcodes") curent_file = file text.delete(0, 'end') text.insert(0, decode(file)) code() display_qrcode() # lit l'image au format PNG et renvoie le texte def decode(file): decoder = cv2.QRCodeDetector() data_text, points, data_code = decoder.detectAndDecode(cv2.imread(file)) return data_text # choix de la couleur du fond # choix de la couleur du fond def set_bg_color(): def set_bg_color(): global bg_color global bg_color Chargement en cours @@ -26,8 +47,9 @@ def set_bg_color(): if selection: if selection: bg_color = selection bg_color = selection bg_color_btn.config(bg=bg_color) bg_color_btn.config(bg=bg_color) if texte_a_coder.get() != "": if text.get() != "": create_qrcode() code() display_qrcode() # si la couleur du fond du code est identique à celle de la fenêtre # si la couleur du fond du code est identique à celle de la fenêtre if bg_color == "#808080": if bg_color == "#808080": Chargement en cours @@ -43,66 +65,76 @@ def set_fg_color(): if selection: if selection: fg_color = selection fg_color = selection fg_color_btn.config(bg=fg_color) fg_color_btn.config(bg=fg_color) if texte_a_coder.get(): if text.get(): create_qrcode() code() display_qrcode() def no_password(value): def no_password(value): if value == "Aucun": if value == "Aucun": titre_saisie_pass.config(state=DISABLED) password_title.config(state=DISABLED) saisie_pass.delete(0, 'end') password.delete(0, 'end') saisie_pass.config(state=DISABLED) password.config(state=DISABLED) else: else: titre_saisie_pass.config(state=NORMAL) password_title.config(state=NORMAL) saisie_pass.config(state=NORMAL) password.config(state=NORMAL) def transfert(): def transfert(): if saisie_ssid.get() != "": if ssid_name.get() != "": ssid = saisie_ssid.get() ssid = ssid_name.get() crypt = choix_crypt.get() crypt = crypt_choice.get() password = saisie_pass.get() pwd = password.get() # SSID caché OUI/NON # SSID caché OUI/NON if choix_cache.get() == "OUI": if hide_choice.get() == "OUI": cache = "True" cache = "True" else: else: cache = "" cache = "" texte_a_coder.delete(0, 'end') # mise à jour du texte à coder code_wifi = "WIFI:T:" + crypt + ";S:" + ssid + ";P:" + password + ";H:" + cache text.delete(0, 'end') texte_a_coder.insert(0, code_wifi) code_wifi = "WIFI:T:" + crypt + ";S:" + ssid + ";P:" + pwd + ";H:" + cache create_qrcode() text.insert(0, code_wifi) # création de l'image du qrcode et affichage code() display_qrcode() else: else: messagebox.showerror("Erreur", "Saisissez un SSID") messagebox.showerror("Erreur", "Saisissez un SSID") def verif_create_qrcode(): def verif_before_code(): if texte_a_coder.get() != "": if text.get() != "": create_qrcode() code() display_qrcode() else: else: messagebox.showerror("Erreur", "Il n'y a pas de données à coder") messagebox.showerror("Erreur", "Il n'y a pas de données à coder") def create_qrcode(): def code(): global qrcode_img global qrcode_img bs = boxe_size_scale.get() bs = boxe_size_scale.get() br = border_size_scale.get() br = border_size_scale.get() qr = qrcode.QRCode( qr = qrcode.QRCode( version=VERSION, version=version, error_correction=ERROR_CORRECT_M, error_correction=ERROR_CORRECT_M, box_size=bs, box_size=bs, border=br border=br ) ) qr.add_data(texte_a_coder.get()) qr.add_data(text.get()) qr.make(fit='True') qr.make(fit='True') # création et sauvegarde de l'image du QRCode # création et sauvegarde de l'image du QRCode img = qr.make_image(fill_color=fg_color, back_color=bg_color) img = qr.make_image(fill_color=fg_color, back_color=bg_color) img.save('qrcode.png') img.save('qrcode.png') def display_qrcode(): global qrcode_img # calcul de la taille du QRCode pour le centrer dans la fenêtre # calcul de la taille du QRCode pour le centrer dans la fenêtre img = Image.open("qrcode.png") img = Image.open("qrcode.png") size = img.size size = img.size Chargement en cours Chargement en cours @@ -136,7 +168,7 @@ menu_fichier = Menu(menu_general, tearoff=0) menu_general.add_cascade(label="Fichier", menu=menu_fichier) menu_general.add_cascade(label="Fichier", menu=menu_fichier) # Création des sous menus 'Fichiers' # Création des sous menus 'Fichiers' menu_fichier.add_command(label="Nouveau") menu_fichier.add_command(label="Nouveau") menu_fichier.add_command(label="Ouvrir") menu_fichier.add_command(label="Ouvrir", command=open_file) menu_fichier.add_command(label="Enregistrer") menu_fichier.add_command(label="Enregistrer") menu_fichier.add_command(label="Enregistrer sous") menu_fichier.add_command(label="Enregistrer sous") menu_fichier.add_command(label="Quitter", command=quit) menu_fichier.add_command(label="Quitter", command=quit) Chargement en cours @@ -163,8 +195,8 @@ bottom_frame.place(x=0, y=421, width=800, height=220) # ===== WIDGETS ===== # ===== WIDGETS ===== # Choix des couleurs # Choix des couleurs titre_choix_couleur = Label(left_frame, text="Choix de couleurs :", bg="#CCCCCC") color_choice = Label(left_frame, text="Choix de couleurs :", bg="#CCCCCC") titre_choix_couleur.place(x=20, y=18) color_choice.place(x=20, y=18) bg_color_btn = Button(left_frame, bg=bg_color, relief=SUNKEN, command=set_bg_color) bg_color_btn = Button(left_frame, bg=bg_color, relief=SUNKEN, command=set_bg_color) bg_color_btn.place(x=82, y=62, width=20, height=20) bg_color_btn.place(x=82, y=62, width=20, height=20) fg_color_btn = Button(left_frame, bg=fg_color, relief=SUNKEN, command=set_fg_color) fg_color_btn = Button(left_frame, bg=fg_color, relief=SUNKEN, command=set_fg_color) Chargement en cours @@ -185,45 +217,45 @@ border_size_scale.set(2) border_size_scale.place(x=180, y=90) border_size_scale.place(x=180, y=90) # ===== point d'accès WIFI ===== # ===== point d'accès WIFI ===== titre_wifi = Label(left_frame, text='CONFIGURATION DU WIFI :', bg="#CCCCCC") wifi_title = Label(left_frame, text='CONFIGURATION DU WIFI :', bg="#CCCCCC") titre_wifi.place(x=30, y=175) wifi_title.place(x=30, y=175) # SSID # SSID titre_saisie_ssid = Label(left_frame, text='SSID :', bg="#CCCCCC") ssid_name_title = Label(left_frame, text='SSID :', bg="#CCCCCC") titre_saisie_ssid.place(x=30, y=200) ssid_name_title.place(x=30, y=200) saisie_ssid = Entry(left_frame, width=40) ssid_name = Entry(left_frame, width=40) saisie_ssid.place(x=30, y=225) ssid_name.place(x=30, y=225) # Password # Password titre_saisie_pass = Label(left_frame, text='Mot de passe :', bg="#CCCCCC") password_title = Label(left_frame, text='Mot de passe :', bg="#CCCCCC") titre_saisie_pass.place(x=30, y=250) password_title.place(x=30, y=250) saisie_pass = Entry(left_frame, width=40) password = Entry(left_frame, width=40) saisie_pass.place(x=30, y=275) password.place(x=30, y=275) # Cryptage # Cryptage titre_choix_crypt = Label(left_frame, text='Cryptage :', bg="#CCCCCC") crypt_title = Label(left_frame, text='Cryptage :', bg="#CCCCCC") titre_choix_crypt.place(x=300, y=200) crypt_title.place(x=300, y=200) crypt_list = ["WPA", "WEP", "Aucun"] crypt_list = ["WPA", "WEP", "Aucun"] choix_crypt = SmartSpinBox(root, entry_type='str', width=8, justify=CENTER, crypt_choice = SmartSpinBox(root, entry_type='str', width=8, justify=CENTER, values=crypt_list, callback=no_password) values=crypt_list, callback=no_password) choix_crypt.place(x=300, y=225) crypt_choice.place(x=300, y=225) # Caché # Caché titre_cache = Label(left_frame, text='Caché :', bg="#CCCCCC") hide_title = Label(left_frame, text='Caché :', bg="#CCCCCC") titre_cache.place(x=300, y=250) hide_title.place(x=300, y=250) cache_list = ["NON", "OUI"] hide_list = ["NON", "OUI"] choix_cache = Spinbox(left_frame, values=cache_list, width=8, justify=CENTER) hide_choice = Spinbox(left_frame, values=hide_list, width=8, justify=CENTER) choix_cache.place(x=300, y=275) hide_choice.place(x=300, y=275) # Transfert du code dans les données à coder # Transfert du code dans les données à coder transfert_btn = Button(left_frame, text="Transfert\nvers\ndonnées", transfert_btn = Button(left_frame, text="Transfert\nvers\ndonnées", bg="#61AEF9", command=transfert) bg="#61AEF9", command=transfert) transfert_btn.place(x=30, y=320, width=60, height=60) transfert_btn.place(x=30, y=320, width=60, height=60) # bouton de création du QRCode # bouton de création du QRCode create_btn = Button(left_frame, text="Créer le Code", bg="#88FF88", command=verif_create_qrcode) code_btn = Button(left_frame, text="Créer le Code", bg="#88FF88", command=verif_before_code) create_btn.place(x=260, y=380, width=100, height=40) code_btn.place(x=260, y=380, width=100, height=40) # texte à coder # texte à coder titre_texte_a_coder = Label(bottom_frame, text='Données à coder :', bg="#CCCCCC") texte_title = Label(bottom_frame, text='Données à coder :', bg="#CCCCCC") titre_texte_a_coder.place(x=30, y=0) texte_title.place(x=30, y=0) texte_a_coder = Entry(bottom_frame, width=122) text = Entry(bottom_frame, width=122) texte_a_coder.place(x=30, y=25) text.place(x=30, y=25) # affichage du QRcode # affichage du QRcode qrcode_img = "" qrcode_img = "" Chargement en cours read_qrcode.py +2 −2 Numéro de ligne d'origine Ligne d'origine Numéro de ligne de diff Ligne de diff # installer le paquet : opencv-python # installer le paquet : opencv-python import cv2 import cv2 d = cv2.QRCodeDetector() decodeur = cv2.QRCodeDetector() val, points, qrcode = d.detectAndDecode(cv2.imread("codes/Kylix.png")) val, points, code = decodeur.detectAndDecode(cv2.imread("qrcodes/qrcode-0.png")) print("Le texte codé est :") print("Le texte codé est :") print(val) print(val) Chargement en cours
README.md +7 −2 Numéro de ligne d'origine Ligne d'origine Numéro de ligne de diff Ligne de diff # objQRCode # objQRCode objQRCode est un utilitaire pour créer des QRCode écrit en python. **objQRCode** est un utilitaire pour créer des QRCode écrit en python. C'est en faite une interface graphique pour **qrcode** (https://pypi.org/project/qrcode/) sous python. L'application est en cours de développement. C'est en faite une interface graphique pour qrcode sous python. ## Paquets à installer : ## Paquets à installer : - qrcode - qrcode Chargement en cours Chargement en cours @@ -40,3 +42,6 @@ https://goqr.me/#t=wifi ### segno - python ### segno - python - https://segno.readthedocs.io/en/latest/index.html - https://segno.readthedocs.io/en/latest/index.html - https://www.freecodecamp.org/news/how-to-create-stunning-qr-codes-with-python - https://www.freecodecamp.org/news/how-to-create-stunning-qr-codes-with-python ### autres : - https://www.youtube.com/watch?v=FShKBCoGeQg&ab_channel=Apprenezlawebradio No newline at end of file
main.py +87 −55 Numéro de ligne d'origine Ligne d'origine Numéro de ligne de diff Ligne de diff Chargement en cours @@ -5,20 +5,41 @@ from tkinter import * from tkinter import * from tkinter import messagebox from tkinter import messagebox from tkinter.colorchooser import askcolor from tkinter.colorchooser import askcolor from tkinter import filedialog from tk_tools import SmartSpinBox from tk_tools import SmartSpinBox import qrcode import qrcode from qrcode.constants import ERROR_CORRECT_M from qrcode.constants import ERROR_CORRECT_M import cv2 from PIL import Image from PIL import Image fg_color = "#000000" fg_color = "#000000" bg_color = "#FFFFFF" bg_color = "#FFFFFF" VERSION = 3 version = 3 curent_file = "" # ===== FONCTIONS ===== # ===== FONCTIONS ===== # ouverture d'un fichier def open_file(): global curent_file file = filedialog.askopenfilename(title="Ouvrir un QRCode au format PNG", defaultextension="png", initialdir="./qrcodes") curent_file = file text.delete(0, 'end') text.insert(0, decode(file)) code() display_qrcode() # lit l'image au format PNG et renvoie le texte def decode(file): decoder = cv2.QRCodeDetector() data_text, points, data_code = decoder.detectAndDecode(cv2.imread(file)) return data_text # choix de la couleur du fond # choix de la couleur du fond def set_bg_color(): def set_bg_color(): global bg_color global bg_color Chargement en cours @@ -26,8 +47,9 @@ def set_bg_color(): if selection: if selection: bg_color = selection bg_color = selection bg_color_btn.config(bg=bg_color) bg_color_btn.config(bg=bg_color) if texte_a_coder.get() != "": if text.get() != "": create_qrcode() code() display_qrcode() # si la couleur du fond du code est identique à celle de la fenêtre # si la couleur du fond du code est identique à celle de la fenêtre if bg_color == "#808080": if bg_color == "#808080": Chargement en cours @@ -43,66 +65,76 @@ def set_fg_color(): if selection: if selection: fg_color = selection fg_color = selection fg_color_btn.config(bg=fg_color) fg_color_btn.config(bg=fg_color) if texte_a_coder.get(): if text.get(): create_qrcode() code() display_qrcode() def no_password(value): def no_password(value): if value == "Aucun": if value == "Aucun": titre_saisie_pass.config(state=DISABLED) password_title.config(state=DISABLED) saisie_pass.delete(0, 'end') password.delete(0, 'end') saisie_pass.config(state=DISABLED) password.config(state=DISABLED) else: else: titre_saisie_pass.config(state=NORMAL) password_title.config(state=NORMAL) saisie_pass.config(state=NORMAL) password.config(state=NORMAL) def transfert(): def transfert(): if saisie_ssid.get() != "": if ssid_name.get() != "": ssid = saisie_ssid.get() ssid = ssid_name.get() crypt = choix_crypt.get() crypt = crypt_choice.get() password = saisie_pass.get() pwd = password.get() # SSID caché OUI/NON # SSID caché OUI/NON if choix_cache.get() == "OUI": if hide_choice.get() == "OUI": cache = "True" cache = "True" else: else: cache = "" cache = "" texte_a_coder.delete(0, 'end') # mise à jour du texte à coder code_wifi = "WIFI:T:" + crypt + ";S:" + ssid + ";P:" + password + ";H:" + cache text.delete(0, 'end') texte_a_coder.insert(0, code_wifi) code_wifi = "WIFI:T:" + crypt + ";S:" + ssid + ";P:" + pwd + ";H:" + cache create_qrcode() text.insert(0, code_wifi) # création de l'image du qrcode et affichage code() display_qrcode() else: else: messagebox.showerror("Erreur", "Saisissez un SSID") messagebox.showerror("Erreur", "Saisissez un SSID") def verif_create_qrcode(): def verif_before_code(): if texte_a_coder.get() != "": if text.get() != "": create_qrcode() code() display_qrcode() else: else: messagebox.showerror("Erreur", "Il n'y a pas de données à coder") messagebox.showerror("Erreur", "Il n'y a pas de données à coder") def create_qrcode(): def code(): global qrcode_img global qrcode_img bs = boxe_size_scale.get() bs = boxe_size_scale.get() br = border_size_scale.get() br = border_size_scale.get() qr = qrcode.QRCode( qr = qrcode.QRCode( version=VERSION, version=version, error_correction=ERROR_CORRECT_M, error_correction=ERROR_CORRECT_M, box_size=bs, box_size=bs, border=br border=br ) ) qr.add_data(texte_a_coder.get()) qr.add_data(text.get()) qr.make(fit='True') qr.make(fit='True') # création et sauvegarde de l'image du QRCode # création et sauvegarde de l'image du QRCode img = qr.make_image(fill_color=fg_color, back_color=bg_color) img = qr.make_image(fill_color=fg_color, back_color=bg_color) img.save('qrcode.png') img.save('qrcode.png') def display_qrcode(): global qrcode_img # calcul de la taille du QRCode pour le centrer dans la fenêtre # calcul de la taille du QRCode pour le centrer dans la fenêtre img = Image.open("qrcode.png") img = Image.open("qrcode.png") size = img.size size = img.size Chargement en cours Chargement en cours @@ -136,7 +168,7 @@ menu_fichier = Menu(menu_general, tearoff=0) menu_general.add_cascade(label="Fichier", menu=menu_fichier) menu_general.add_cascade(label="Fichier", menu=menu_fichier) # Création des sous menus 'Fichiers' # Création des sous menus 'Fichiers' menu_fichier.add_command(label="Nouveau") menu_fichier.add_command(label="Nouveau") menu_fichier.add_command(label="Ouvrir") menu_fichier.add_command(label="Ouvrir", command=open_file) menu_fichier.add_command(label="Enregistrer") menu_fichier.add_command(label="Enregistrer") menu_fichier.add_command(label="Enregistrer sous") menu_fichier.add_command(label="Enregistrer sous") menu_fichier.add_command(label="Quitter", command=quit) menu_fichier.add_command(label="Quitter", command=quit) Chargement en cours @@ -163,8 +195,8 @@ bottom_frame.place(x=0, y=421, width=800, height=220) # ===== WIDGETS ===== # ===== WIDGETS ===== # Choix des couleurs # Choix des couleurs titre_choix_couleur = Label(left_frame, text="Choix de couleurs :", bg="#CCCCCC") color_choice = Label(left_frame, text="Choix de couleurs :", bg="#CCCCCC") titre_choix_couleur.place(x=20, y=18) color_choice.place(x=20, y=18) bg_color_btn = Button(left_frame, bg=bg_color, relief=SUNKEN, command=set_bg_color) bg_color_btn = Button(left_frame, bg=bg_color, relief=SUNKEN, command=set_bg_color) bg_color_btn.place(x=82, y=62, width=20, height=20) bg_color_btn.place(x=82, y=62, width=20, height=20) fg_color_btn = Button(left_frame, bg=fg_color, relief=SUNKEN, command=set_fg_color) fg_color_btn = Button(left_frame, bg=fg_color, relief=SUNKEN, command=set_fg_color) Chargement en cours @@ -185,45 +217,45 @@ border_size_scale.set(2) border_size_scale.place(x=180, y=90) border_size_scale.place(x=180, y=90) # ===== point d'accès WIFI ===== # ===== point d'accès WIFI ===== titre_wifi = Label(left_frame, text='CONFIGURATION DU WIFI :', bg="#CCCCCC") wifi_title = Label(left_frame, text='CONFIGURATION DU WIFI :', bg="#CCCCCC") titre_wifi.place(x=30, y=175) wifi_title.place(x=30, y=175) # SSID # SSID titre_saisie_ssid = Label(left_frame, text='SSID :', bg="#CCCCCC") ssid_name_title = Label(left_frame, text='SSID :', bg="#CCCCCC") titre_saisie_ssid.place(x=30, y=200) ssid_name_title.place(x=30, y=200) saisie_ssid = Entry(left_frame, width=40) ssid_name = Entry(left_frame, width=40) saisie_ssid.place(x=30, y=225) ssid_name.place(x=30, y=225) # Password # Password titre_saisie_pass = Label(left_frame, text='Mot de passe :', bg="#CCCCCC") password_title = Label(left_frame, text='Mot de passe :', bg="#CCCCCC") titre_saisie_pass.place(x=30, y=250) password_title.place(x=30, y=250) saisie_pass = Entry(left_frame, width=40) password = Entry(left_frame, width=40) saisie_pass.place(x=30, y=275) password.place(x=30, y=275) # Cryptage # Cryptage titre_choix_crypt = Label(left_frame, text='Cryptage :', bg="#CCCCCC") crypt_title = Label(left_frame, text='Cryptage :', bg="#CCCCCC") titre_choix_crypt.place(x=300, y=200) crypt_title.place(x=300, y=200) crypt_list = ["WPA", "WEP", "Aucun"] crypt_list = ["WPA", "WEP", "Aucun"] choix_crypt = SmartSpinBox(root, entry_type='str', width=8, justify=CENTER, crypt_choice = SmartSpinBox(root, entry_type='str', width=8, justify=CENTER, values=crypt_list, callback=no_password) values=crypt_list, callback=no_password) choix_crypt.place(x=300, y=225) crypt_choice.place(x=300, y=225) # Caché # Caché titre_cache = Label(left_frame, text='Caché :', bg="#CCCCCC") hide_title = Label(left_frame, text='Caché :', bg="#CCCCCC") titre_cache.place(x=300, y=250) hide_title.place(x=300, y=250) cache_list = ["NON", "OUI"] hide_list = ["NON", "OUI"] choix_cache = Spinbox(left_frame, values=cache_list, width=8, justify=CENTER) hide_choice = Spinbox(left_frame, values=hide_list, width=8, justify=CENTER) choix_cache.place(x=300, y=275) hide_choice.place(x=300, y=275) # Transfert du code dans les données à coder # Transfert du code dans les données à coder transfert_btn = Button(left_frame, text="Transfert\nvers\ndonnées", transfert_btn = Button(left_frame, text="Transfert\nvers\ndonnées", bg="#61AEF9", command=transfert) bg="#61AEF9", command=transfert) transfert_btn.place(x=30, y=320, width=60, height=60) transfert_btn.place(x=30, y=320, width=60, height=60) # bouton de création du QRCode # bouton de création du QRCode create_btn = Button(left_frame, text="Créer le Code", bg="#88FF88", command=verif_create_qrcode) code_btn = Button(left_frame, text="Créer le Code", bg="#88FF88", command=verif_before_code) create_btn.place(x=260, y=380, width=100, height=40) code_btn.place(x=260, y=380, width=100, height=40) # texte à coder # texte à coder titre_texte_a_coder = Label(bottom_frame, text='Données à coder :', bg="#CCCCCC") texte_title = Label(bottom_frame, text='Données à coder :', bg="#CCCCCC") titre_texte_a_coder.place(x=30, y=0) texte_title.place(x=30, y=0) texte_a_coder = Entry(bottom_frame, width=122) text = Entry(bottom_frame, width=122) texte_a_coder.place(x=30, y=25) text.place(x=30, y=25) # affichage du QRcode # affichage du QRcode qrcode_img = "" qrcode_img = "" Chargement en cours
read_qrcode.py +2 −2 Numéro de ligne d'origine Ligne d'origine Numéro de ligne de diff Ligne de diff # installer le paquet : opencv-python # installer le paquet : opencv-python import cv2 import cv2 d = cv2.QRCodeDetector() decodeur = cv2.QRCodeDetector() val, points, qrcode = d.detectAndDecode(cv2.imread("codes/Kylix.png")) val, points, code = decodeur.detectAndDecode(cv2.imread("qrcodes/qrcode-0.png")) print("Le texte codé est :") print("Le texte codé est :") print(val) print(val)