Re: A question about time

2005-06-09 Thread John Machin
Jan Danielsson wrote: > Hello all, > >I have a list of servers which an application connects to. If the > connection fails, the application should mark the server as temporarily > unavailable, and should try to use the server again after x units of time. > > In C, I would do this: > > server

Re: A question about time

2005-06-09 Thread Jan Danielsson
Grant Edwards wrote: >>In C, I would do this: >> >>server.invalidUntil = time(NULL) + 5*60; // five minute delay > > In Python, I would do this: > > server.invalidUntil = time.time() + 5*60 # five minute delay Ah. Well. Um. I feel like an idiot. I found datetime by accident, and thought "it

Re: A question about time

2005-06-09 Thread Grant Edwards
On 2005-06-09, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2005-06-09, Jan Danielsson <[EMAIL PROTECTED]> wrote: > >> In C, I would do this: >> >> server.invalidUntil = time(NULL) + 5*60; // five minute delay > > In Python, I would do this: > > server.invalidUntil = time.time() + 5*60 # five min

Re: A question about time

2005-06-09 Thread Grant Edwards
On 2005-06-09, Jan Danielsson <[EMAIL PROTECTED]> wrote: > In C, I would do this: > > server.invalidUntil = time(NULL) + 5*60; // five minute delay In Python, I would do this: server.invalidUntil = time.time() + 5*60 # five minute delay > ..and the check: > > if(time(NULL) > server.invalidUtil

RE: A question about time

2005-06-09 Thread Ivan Shevanski
From: Jan Danielsson <[EMAIL PROTECTED]> To: python-list@python.org Subject: A question about time Date: Thu, 09 Jun 2005 22:58:17 +0200 Hello all, I have a list of servers which an application connects to. If the connection fails, the application should mark the server as temporarily una