repl.it
@PySimpleGUI/

Popup Demonstration

Python

No description

fork
loading
Files
  • main.py
  • Packager files
  • poetry.lock
  • pyproject.toml
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import PySimpleGUIWeb as sg

"""
  ____                         
 |  _ \ ___  _ __  _   _ _ __  
 | |_) / _ \| '_ \| | | | '_ \ 
 |  __/ (_) | |_) | |_| | |_) |
 |_|   \___/| .__/ \__,_| .__/ 
            |_|         |_|  
              
A Popup demonstration. A "Popup" window is shown over the main
window.  Clicking OK will close the Popup and you return to main again.
"""

print('Starting up...')

layout = [
            [sg.Text('Your typed chars appear here:'), sg.Text('', key='_OUTPUT_')],
            [sg.Input(do_not_clear=True, key='_IN_')],
            [sg.Button('Show'), sg.Button('Exit'), sg.Button('Blank')]
         ]

window = sg.Window('Window Title').Layout(layout)

while True:             # Event Loop
  print('in event loop')
  event, values = window.Read()
  print(event, values)
  if event is None or event == 'Exit':
      break
  if event == 'Show':
      sg.Popup('A popup!', ' You typed ', values['_IN_'])

window.Close()
Fetching token
?