Skip to content

Commit 4591d78

Browse files
add if __name__ == '__main__':, renamed two functions, renamed one variable.
As a consequence, one comment on parameters was also modified in Canvas, but it seemed appropriate.
1 parent e66331e commit 4591d78

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

examples/rotary_scale.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
from tk_tools.images import rotary_gauge_volt
55

66

7-
def inc():
7+
def increment():
88
global value
9-
value += increment
9+
value += increment_value
1010

1111
p1.set_value(value)
1212
p2.set_value(value)
1313

1414

15-
def dec():
15+
def decrement():
1616
global value
17-
value -= increment
17+
value -= increment_value
1818

1919
p1.set_value(value)
2020
p2.set_value(value)
@@ -36,18 +36,18 @@ def dec():
3636

3737
p2.grid(row=0, column=1)
3838

39-
increment = 1.0
39+
increment_value = 1.0
4040
value = 0.0
4141

4242
inc_btn = tk.Button(root,
43-
text='increment by {}'.format(increment),
44-
command=inc)
43+
text='increment_value by {}'.format(increment_value),
44+
command=increment)
4545

4646
inc_btn.grid(row=1, column=0, columnspan=2, sticky='news')
4747

4848
dec_btn = tk.Button(root,
49-
text='decrement by {}'.format(increment),
50-
command=dec)
49+
text='decrement by {}'.format(increment_value),
50+
command=decrement)
5151

5252
dec_btn.grid(row=2, column=0, columnspan=2, sticky='news')
5353

tk_tools/canvas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def frange(start, stop, step, digits_to_round=3):
314314
315315
:param start: starting value
316316
:param stop: ending value
317-
:param step: the increment
317+
:param step: the increment_value
318318
:param digits_to_round: the digits to which to round \
319319
(makes floating-point numbers much easier to work with)
320320
:return: generator

0 commit comments

Comments
 (0)