I'm totaly new to python and I'm struggling with a subprocess.call. I have a little form that lets the user inputs the length of seconds for a video. Once the users presses the button the python script should call a shell script like:
the shell command works on its own.Code:/home/pi/Scripts/sec=10 ./take_video
My questions is now how to write the subprocess call correctly including the variable vid_time read from the user input field.
Help would be welcomed.Code:# Click on Button Take Video def onvidclick(self): vid_time = self.txt.get_text() subprocess.call(['/home/pi/Scripts/sec=' + vid_time + ' ./take_video']) ts = time.time() localtime = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S') button_text = "Took a video at: " + localtime self.title.set_text(button_text)