I have a python script which detects the motion from webcam or a video.
I need a GUI to start this python script. I created my GUI by using PyQt5 Designer and I want to click a button to open my motion_detector.py
Here is my code.
I have a button in GUI
self.pushButton.setObjectName("pushButton")
I try to open my motion_detector.py by clicking this button
self.pushButton.clicked.connect(lambda:os.system('python motion_detector.py'))
At the top of my code I imported "os"
and also I put my GUI file untitled.py
and my motion_detector.py
in the same directory.
When I try to run it gives me an error
python: can't open file 'motion_detector.py': [Errno 2] No such file or directory
Thank you for your help!