-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestTV.py
44 lines (33 loc) · 1.23 KB
/
TestTV.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
35
36
37
38
39
40
41
42
43
44
# TEST DRIVER PROGRAMS
# import modules
from TV import TV
import PySimpleGUI as sg
# Define TestTV
def TestTV():
# Insert theme
sg.theme('LightBlue')
# Create two objects
tv1 = TV()
tv2 = TV()
# turn on tv1 and set its channel t0 30 and volume to 3
tv1.turnOn()
tv1.setChannel(30)
tv1.setVolume(3)
# Turn on tv2 and sets its channel to 3 and volume to 2
tv2.turnOn()
tv2.setChannel(3)
tv2.setVolume(2)
TestTV = 'TV sets'
# Place two objects into TestTV layout
TestTV_layout = [
[sg.Text(TestTV.center(50), font=('Algerian', 25), justification='center')],
[sg.Frame('', [[sg.Text(f"TV1's channel is {tv1.getChannel()} and volume level is {tv1.getVolume()}.", size=(35,1), font=('Elephant',12))]], background_color='Orange',border_width=3)],
[sg.Frame('', [[sg.Text(f"TV2's channel is {tv2.getChannel()} and volume level is {tv2.getVolume()}.", size=(35,1), font=('Elephant',12))]], background_color='Green',border_width=3)]
]
# Create TestTV window
TestTV_window = sg.Window('Test Driver Program', TestTV_layout, size=(400, 150))
# Read and close window
TestTV_window.read()
TestTV_window.close()
if __name__ == '__main__':
TestTV()