May-13-2022, 06:05 PM
(May-13-2022, 05:30 PM)mikepy Wrote: Hello, is there a possibility or library to convert the following string to a function?
func_str = '''def test(event, x, y, flags, data): if event == cv2.EVENT_LBUTTONDOWN: print('LEFT MOUSE BTN DOWN!!!') if event == cv2.EVENT_RBUTTONDOWN: print('RIGHT MOUSE BTN DOWN!!!') if event == cv2.EVENT_MBUTTONDOWN: print('MIDDLE MOUSE BTN DOWN!!!')'''
I need this to provide the possibility to the user to write his own callbacks.