Pycharm
Pycharm
import tkinter as tk
from tkinter import *
from PIL import Image, ImageTk
from datetime import datetime
from tkinter import messagebox, filedialog
import numpy as np
from pyzbar.pyzbar import decode
import serial
Arduino_Serial = serial.Serial('COM4',9600)
s = Arduino_Serial.readline()
ShowFeed()
if ret:
# Flipping the frame vertically
frame = cv2.flip(frame, 1)
for barcode in decode(frame):
# print(barcode.data)
mydata = barcode.data.decode('utf-8')
print(mydata)
destPath.set(mydata)
root.textLable.configure(text=destPath.get())
else:
myOutput = 'Khong trong kho'
myColor = (0, 0, 255)
checkPath.set(FALSE)
# Keeping a reference
root.cameraLabel.imgtk = imgtk
# Defining Capture() to capture and save the image and display the image in
the imageLabel
# def Capture():
# # Storing the date in the mentioned format in the image_name variable
# image_name = datetime.now().strftime('%d-%m-%Y %H-%M-%S')
# root.textLable.configure(text=destPath.get())
# #
# # # Capturing the frame
# # ret, frame = root.cap.read()
# open file
with open('MyData.text') as f:
myDataList = f.read().splitlines()
print(myDataList)
# Setting the title, window size, background color and disabling the resizing
property
root.title("Pycam")
root.geometry("700x800")
root.resizable(True, True)
root.configure(background="sky blue")
createwidgets()
root.mainloop()
cv2.destroyAllWindows()