Reputation: 1
I have a problem with my python, I have copied and pasted every thing from raspberry pi to pc and downloaded visual studio code to run it, and downloaded python and guizero to my pc via command terminal but even then, when I run my code, it opens up a window of it for about 1 second without loading and then immediately after it shuts, can anyone help, my code is here:
from guizero import App, Combo, Text, CheckBox, ButtonGroup, PushButton, info
def do_booking():
info('Booking', 'Thank you for Booking')
print( film_choice.value )
print( vip_seat.value )
print( row_choice.value )
app = App(title="My second GUI app", width=500, height=200, layout="grid")
film_discription = Text(app, text='Which film do you want to watch?', grid=[0,0], align='left')
film_choice = Combo(app, options=['Star Wars', 'Harry Potter', 'Frozen', 'Lion King'], grid=[1,0], align='left')
vip_seat_discription = Text(app, text='VIP is more comfy and can go down', grid=[0,1], align='left')
vip_seat = CheckBox(app, text='VIP seat?', grid=[1,1], align='left')
row_choice_disciption = Text(app, text='Where do you want to sit?', grid=[0,2], align='left')
row_choice = ButtonGroup(app, options=[ ['Front', 'F'], ['Middle', 'M'], ['Back', 'B'] ], selected='M', horizontal=True, grid=[1,2], align='left')
book_seats = PushButton(app, command=do_booking, text='Book Seat', grid=[1,3], align='left')
app.display
I have tried importing a wait command and using that to stop it from closing but it just says not responding, and then when the wait is up, it shuts
Upvotes: -1
Views: 36
Reputation: 11
You're missing the open close brackets at the end of app.display()
:)
Upvotes: 1