Re: [Tutor] Countdown Clock Programming Question

2015-12-15 Thread Alan Gauld
On 15/12/15 17:10, Alan Gauld wrote: > > import tkinter as tk > > def count_down(start,stop): >display['text'] = str(start) >if start > stop: > top.after(1000, lambda : count_down(start-1,stop)) > > top = tk.Tk() > display = tk.Button(top,text="Press"

Re: [Tutor] Countdown Clock Programming Question

2015-12-15 Thread Alan Gauld
On 15/12/15 14:18, Evan Sommer wrote: > Hey there Alan! > > So I tried some of your modifications, and they seem to be doing some > pretty interesting things with the program. For some reason, now the > program runs extremely fast, and doesn't now count down in one second > intervals. I think this

Re: [Tutor] Countdown Clock Programming Question

2015-12-15 Thread Evan Sommer
Hey there Alan! So I tried some of your modifications, and they seem to be doing some pretty interesting things with the program. For some reason, now the program runs extremely fast, and doesn't now count down in one second intervals. I think this is a result of the root.after command. I still ge

Re: [Tutor] Countdown Clock Programming Question

2015-12-01 Thread Alan Gauld
On 01/12/15 10:16, Alan Gauld wrote: >>> def count_down(): >>> # start with 4 minutes --> 240 seconds >>> for t in range(240, 120, -1): >>> # format as 2 digit integers, fills with zero to the left >>> # divmod() gives minutes, seconds >>> sf = "{:01d}:{:02d}".forma

Re: [Tutor] Countdown Clock Programming Question

2015-12-01 Thread Alan Gauld
On 30/11/15 19:23, Evan Sommer wrote: > Hello again Alan! > > Do you think you could write a revised code with the modifications that > you suggested? I tried changing the code with your recommendations and I > keep getting syntax errors. My code was just an approximation known as 'pseudo code'

Re: [Tutor] Countdown Clock Programming Question

2015-11-30 Thread Evan Sommer
Hello again Alan! Do you think you could write a revised code with the modifications that you suggested? I tried changing the code with your recommendations and I keep getting syntax errors. If you could do that, I would greatly appreciate it!! Thank you for all your help! Evan Sommer On Tue,

Re: [Tutor] Countdown Clock Programming Question

2015-11-24 Thread Alan Gauld
On 24/11/15 19:48, Laura Creighton wrote: > Welcome Evan. > > In a message of Tue, 24 Nov 2015 18:19:22 +, Alan Gauld writes: >> def update_display() >>display_period = target_time - time.time() >>min,sec = divmod(display_period,60) >>if min < 2: set color to yellow >>elif: min

Re: [Tutor] Countdown Clock Programming Question

2015-11-24 Thread Laura Creighton
Welcome Evan. In a message of Tue, 24 Nov 2015 18:19:22 +, Alan Gauld writes: >def update_display() >display_period = target_time - time.time() >min,sec = divmod(display_period,60) >if min < 2: set color to yellow >elif: min < 1: set color to red >else: set color to green >

Re: [Tutor] Countdown Clock Programming Question

2015-11-24 Thread Alan Gauld
On 24/11/15 14:01, Evan Sommer wrote: > goal is for the clock to change from green to yellow at 2 minutes, and > yellow to red at 1 minute. > def count_down(): > # start with 4 minutes --> 240 seconds > for t in range(240, 120, -1): > # format as 2 digit integers, fills with zer

[Tutor] Countdown Clock Programming Question

2015-11-24 Thread Evan Sommer
Hello there! I am working on a project for an engineering class that I am in at my high school, and our task has been to create a clock that counts down the time between periods, so that the students walking the hallways know how much time they have to get to class. The timer will be displayed on