I am trying to make a python GUI, which controls my little StopMotion App. Here is the code:
Every time I take a picture with my GPIO button, there is this error:
Code: Select all
from picamera import PiCamera from guizero import App, Text, Slider, TextBox, PushButton from time import sleep from gpiozero import Button from os import system def change_FPS(slider_value): FPS.value = slider_value def check(): checktext1.set(folder_name.get()) checktext2.set(output_name.get()) def start_stopmotion(): camera.start_preview(alpha=192) frame = 1 while True: try: button.wait_for_press() camera.capture("/home/pi/Desktop/StopMotion/" + str(folder_name) + "/frame%03d.jpg" % frame) frame += 1 except KeyboardInterrupt: camera.stop_preview() start = False break system('avconv -r ' + str(FPS) + ' -i /Desktop/StopMotion/ ' + str(folder_name) + '/frame%03d.jpg -qscale 2 ' + output_name + '.h264') app = App(title="StopMotion") welcome_message = Text(app, text='''Welcome to Stop Motion! Please enter he name of the folder you will be importing the images. This folder should be located in /home/pi/Desktop/StopMotion. After that please enter the name of the file which will be created.''') button = Button(17) camera = PiCamera() text1 = Text(app, text='Enter folder name: ') folder_name = TextBox(app, width=30) text2 = Text(app, text='Enter file name:') output_name = TextBox(app, width=30) text3 = Text(app, text='Enter number of FPS on the slider:') FPS = Slider(app, command=change_FPS, start=1, end=30) text4 = Text(app, text='''You can take pictures by pressing the button. After desired number of frames press ctrl + c. Good Luck!''') pushbutton = PushButton(app, command=start_stopmotion, text='Start StopMotion!') checkbuton = PushButton(app, command=check, text='Check values') checktext1 = Text(app, text='NO INFO') checktext2 = Text(app, text='NO INFO') app.display()
Is there anything I am doing wrong? Please help!
Code: Select all
stream = io.open(stream, 'wb' if output else 'rb', buffering) FileNotFoundError: [Errno 2] No such file or directory: '/home/pi/Desktop/StopMotion/[TextBox] object with text ""/frame001.jpg'
Thanks in advance!