main.py
def code_reader_engine(self):
        '''
        Dealing with the main components of QR code reading
        '''
        make_status_msg = "----- QR Code Reader -----"
        self.log_msg_entry(make_status_msg)

        file_names = self.reader_text_box.get()
        file_names = [file_name.strip() for file_name in file_names.split(",")]

        for file_path in file_names:
            if not os.path.isfile(file_path):
                make_status_msg = "[ERROR] " + file_path + ": Image not found."
                self.log_msg_entry(make_status_msg)
            else:
                # Reading QR code using pyzbar
                image_file = Image.open(file_path)
                decoded = pyzbar.decode(image_file)

                if decoded:
                    for obj in decoded:
                        file_path = obj.data.decode("utf-8")
                        # print(file_path)

                        if os.path.isfile(file_path):
                            make_status_msg = "[SUCCESS] " + file_path + ": QR code decoded. Opening file..."
                            self.log_msg_entry(make_status_msg)

                            open_command = SHELL_PATH + " " + SHELL_COMMAND + " \\\"" + file_path + "\\\""
                            subprocess.run(open_command, shell=True)
                        else:
                            make_status_msg = "[ERROR] " + file_path + ": QR code decoded, however file path not found."
                            self.log_msg_entry(make_status_msg)
                else:
                    make_status_msg = "[ERROR] " + file_path + ": QR code in target image not found."
                    self.log_msg_entry(make_status_msg)

        Dealing with the main components of QR code reading
        
Dealing with the main components of QR code reading
Dealing with the main components of QR code reading
def code_reader_engine(self):
        make_status_msg = "----- QR Code Reader -----"
        self.log_msg_entry(make_status_msg)
        file_names = self.reader_text_box.get()
        file_names = [file_name.strip() for file_name in file_names.split(",")]
        for file_path in file_names:
            if not os.path.isfile(file_path):
                make_status_msg = "[ERROR] " + file_path + ": Image not found."
                self.log_msg_entry(make_status_msg)
            else:
                image_file = Image.open(file_path)
                decoded = pyzbar.decode(image_file)
                if decoded:
                    for obj in decoded:
                        file_path = obj.data.decode("utf-8")
                        if os.path.isfile(file_path):
                            make_status_msg = "[SUCCESS] " + file_path + ": QR code decoded. Opening file..."
                            self.log_msg_entry(make_status_msg)
                            open_command = SHELL_PATH + " " + SHELL_COMMAND + " \\\"" + file_path + "\\\""
                            subprocess.run(open_command, shell=True)
                        else:
                            make_status_msg = "[ERROR] " + file_path + ": QR code decoded, however file path not found."
                            self.log_msg_entry(make_status_msg)
                else:
                    make_status_msg = "[ERROR] " + file_path + ": QR code in target image not found."
                    self.log_msg_entry(make_status_msg)
def code_reader_engine ( self ) : make_status_msg = "----- QR Code Reader -----" self . log_msg_entry ( make_status_msg ) file_names = self . reader_text_box . get ( ) file_names = [ file_name . strip ( ) for file_name in file_names . split ( "," ) ] for file_path in file_names : if not os . path . isfile ( file_path ) : make_status_msg = "[ERROR] " + file_path + ": Image not found." self . log_msg_entry ( make_status_msg ) else : image_file = Image . open ( file_path ) decoded = pyzbar . decode ( image_file ) if decoded : for obj in decoded : file_path = obj . data . decode ( "utf-8" ) if os . path . isfile ( file_path ) : make_status_msg = "[SUCCESS] " + file_path + ": QR code decoded. Opening file..." self . log_msg_entry ( make_status_msg ) open_command = SHELL_PATH + " " + SHELL_COMMAND + " \\\"" + file_path + "\\\"" subprocess . run ( open_command , shell = True ) else : make_status_msg = "[ERROR] " + file_path + ": QR code decoded, however file path not found." self . log_msg_entry ( make_status_msg ) else : make_status_msg = "[ERROR] " + file_path + ": QR code in target image not found." self . log_msg_entry ( make_status_msg )
Dealing with the main components of QR code reading
Dealing with the main components of QR code reading
'''
        Dealing with the main components of QR code reading
        ''' # Reading QR code using pyzbar # print(file_path)
self