-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnumeros.py
More file actions
117 lines (94 loc) · 1.88 KB
/
numeros.py
File metadata and controls
117 lines (94 loc) · 1.88 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import tkinter as tk
digits = [
[' 11111 ',
'1 1',
'1 1',
'1 1',
'1 1',
'1 1',
' 11111 '],
[' 11 ',
' 111 ',
' 11 ',
' 11 ',
' 11 ',
' 11 ',
' 11111'],
[' 11111 ',
'1 1',
' 1',
' 11',
' 11 ',
' 11 ',
'1111111'],
[' 11111 ',
'1 1',
' 1',
' 1111 ',
' 1',
'1 1',
' 11111 '],
[' 11 ',
' 111 ',
' 1 11 ',
'1 11 ',
'1111111',
' 11 ',
' 11 '],
['1111111',
'11 ',
'11 ',
'111111 ',
' 11',
'1 1',
' 11111 '],
[' 11111 ',
'1 1',
'11 ',
'111111 ',
'1 1',
'1 1',
' 11111 '],
['1111111',
' 11',
' 11 ',
' 11 ',
' 11 ',
' 11 ',
'11 '],
[' 11111 ',
'1 1',
'1 1',
' 11111 ',
'1 1',
'1 1',
' 11111 '],
[' 11111 ',
'1 1',
'1 1',
' 111111',
' 1',
'1 1',
' 11111 ']
]
def print_number(num):
digs = str(num)
lines = ['' for _ in range(7)]
for d in digs:
dig_lines = digits[int(d)]
for i in range(7):
lines[i] += dig_lines[i] + ' '
return lines
def update_display():
number = int(entry.get())
lines = print_number(number)
display.config(text='\n'.join(lines))
root = tk.Tk()
root.title("Números")
entry = tk.Entry(root)
entry.pack()
display = tk.Label(root, font=('Courier New', 14), width=60, height=7)
display.pack()
update_button = tk.Button(root, text="Actualizar", command=update_display)
update_button.pack()
root.mainloop()