FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PySimpleGUI/DemoPrograms/Demo_Debugger_Button.py at master · PySimpleGUI/PySimpleGUI · GitHub
PySimpleGUI
/
PySimpleGUI
Public
Notifications
You must be signed in to change notification settings
Fork
1.8k
Star
13.8k
Code
Issues
708
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
PySimpleGUI
/
DemoPrograms
/
Demo_Debugger_Button.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
52 lines (43 loc) · 1.83 KB
Breadcrumbs
PySimpleGUI
/
DemoPrograms
/
Demo_Debugger_Button.py
Copy path
File metadata and controls
52 lines (43 loc) · 1.83 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import
PySimpleGUI
as
sg
# import imwatchingyou # STEP 1
"""
Demo program that shows you how to integrate the PySimpleGUI Debugger
into your program.
This particular program is a GUI based program simply to make it easier for you to interact and change
things.
In this example, the debugger is not started initiallly. You click the "Debug" button to launch it
There are THREE steps, and they are copy and pastes.
1. At the top of your app to debug add
import imwatchingyou
2. When you want to show a debug window, call one of two functions:
imwatchingyou.show_debug_window()
imwatchingyou.show_popout_window()
3. You must find a location in your code to "refresh" the debugger. Some loop that's executed often.
In this loop add this call:
imwatchingyou.refresh()
Copyright 2018-2026 PySimpleGUI. All rights reserved.
"""
layout
=
[
[
sg
.
Text
(
'A typical PSG application'
)],
[
sg
.
Input
(
key
=
'-IN-'
)],
[
sg
.
Text
(
' '
,
key
=
'-OUT-'
,
size
=
(
45
,
1
))],
[
sg
.
CBox
(
'Checkbox 1'
),
sg
.
CBox
(
'Checkbox 2'
)],
[
sg
.
Radio
(
'a'
,
1
,
key
=
'-R1-'
),
sg
.
Radio
(
'b'
,
1
,
key
=
'-R2-'
),
sg
.
Radio
(
'c'
,
1
,
key
=
'-R3-'
)],
[
sg
.
Combo
([
'c1'
,
'c2'
,
'c3'
],
size
=
(
6
,
3
),
key
=
'-COMBO-'
)],
[
sg
.
Output
(
size
=
(
50
,
6
))],
[
sg
.
Ok
(),
sg
.
Exit
(),
sg
.
Button
(
'Enable'
),
sg
.
Debug
(
key
=
'Debug'
)],
]
window
=
sg
.
Window
(
'This is your Application Window'
,
layout
,
debugger_enabled
=
False
)
counter
=
0
while
True
:
# Your Event Loop
event
,
values
=
window
.
read
(
timeout
=
100
)
if
event
in
(
sg
.
WIN_CLOSED
,
'Exit'
):
break
elif
event
==
'Enable'
:
window
.
enable_debugger
()
counter
+=
1
# to prove window is operating, show the input in another area in the window.
window
[
'-OUT-'
].
update
(
values
[
'-IN-'
])
window
.
close
()
Back
|
FazBrowse Home
|
New Git URL