Major update of all demo programs to use new PEP8 bindings, etc

This commit is contained in:
PySimpleGUI 2019-10-23 16:10:03 -04:00
parent 3f7c87c562
commit 7f52778bcc
307 changed files with 19546 additions and 3297 deletions

View file

@ -0,0 +1,25 @@
#!/usr/bin/env python
import sys
if sys.version_info[0] >= 3:
import PySimpleGUI as sg
else:
import PySimpleGUI27 as sg
layout = [[sg.Text("Hold down a key")],
[sg.Button("OK")]]
window = sg.Window("Realtime Keyboard Test", return_keyboard_events=True, use_default_focus=False).Layout(layout)
while True:
event, values = window.Read(timeout=0)
if event == "OK":
print(event, values, "exiting")
break
if event is not sg.TIMEOUT_KEY:
if len(event) == 1:
print('%s - %s' % (event, ord(event)))
else:
print(event)
elif event is None:
break