什么样的模块、语法、函数或者我需要使用类(oop)?我还是个婴儿 python3, opencv4....请帮忙
gui.py
'''
from guizero import App, PushButton
def do_nothing()
print('Button was pressed')
app=App()
button=PushButton(app,command=do_nothing)
app.display()
'''
主文件
'''
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
cap.set(3,640) # set Width
cap.set(4,480) # set Height
while(True):
ret, frame = cap.read()
frame = cv2.flip(frame, -1) # Flip camera vertically
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imshow('frame', frame)
cv2.imshow('gray', gray)
k = cv2.waitKey(30) & 0xff
if k == 27: # press 'ESC' to quit
break
'''
现在,我只想拥有简单的用户界面...只需按下''(button1),main.py 就会弹出