-
Notifications
You must be signed in to change notification settings - Fork 0
/
ninecells.py
31 lines (24 loc) · 924 Bytes
/
ninecells.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
"""
Author: Leigh Stauffer
Program 1
Filename: ninecells.py
Creates a program that displays a window with nine cells on a 3 by 3 grid.
The label of each cell is centered in the middle of its respective cell.
"""
from breezypythongui import EasyFrame
class NineCells(EasyFrame):
"""Displays the nine cells and their respective labels."""
def __init__(self):
"""Sets up the window and the labels."""
EasyFrame.__init__(self, "NineCells")
for x in range (0,3):
for y in range (0,3):
labelText = "(" + str(x) + "," + str(y) + ")"
self.addLabel (text = labelText, row = y , column = x,
sticky = "NSEW")
def main():
"""The starting point for launching the program."""
NineCells().mainloop()
#Instantiates and pops up the window.
if __name__ == "__main__":
main()