Re: [Tutor] Need help with dates in Python

2011-03-11 Thread nookasree ponamala
Thanks for your help Francesco. This works. Sree. --- On Fri, 3/11/11, Francesco Loffredo wrote: > From: Francesco Loffredo > Subject: Re: [Tutor] Need help with dates in Python > To: tutor@python.org > Date: Friday, March 11, 2011, 1:05 AM > On 09/03/2011 9.21, nookasree &

Re: [Tutor] Need help with dates in Python

2011-03-10 Thread nookasree ponamala
3/10/11, James Reynolds wrote: From: James Reynolds Subject: Re: [Tutor] Need help with dates in Python To: "nookasree ponamala" Cc: "Andre Engels" , tutor@python.org Date: Thursday, March 10, 2011, 2:26 AM On Wed, Mar 9, 2011 at 1:34 PM, nookasree ponamala wrote: Hi,

Re: [Tutor] Need help with dates in Python

2011-03-10 Thread Francesco Loffredo
On 09/03/2011 9.21, nookasree ponamala wrote: Hi, I need help in finding the minimum date and maximum date in a file. Here is my test file: s.no: dt1 amt id1 id2 452 2010-02-20 $23.26 05954206107 452 2010-02-05 $20.78 05954206107 451

Re: [Tutor] Need help with dates in Python

2011-03-09 Thread Prasad, Ramit
Street | Houston, TX 77002 work phone: 713 - 216 - 5423 From: tutor-bounces+ramit.prasad=jpmchase@python.org [mailto:tutor-bounces+ramit.prasad=jpmchase@python.org] On Behalf Of James Reynolds Sent: Wednesday, March 09, 2011 2:57 PM To: nookasree ponamala Cc: tutor@python.org Subject: Re: [Tuto

Re: [Tutor] Need help with dates in Python

2011-03-09 Thread James Reynolds
d(t) > print t > > Thanks > Sree. > > --- On Wed, 3/9/11, Andre Engels wrote: > > > From: Andre Engels > > Subject: Re: [Tutor] Need help with dates in Python > > To: "nookasree ponamala" > > Cc: tutor@python.org > > Date:

Re: [Tutor] Need help with dates in Python

2011-03-09 Thread Steven D'Aprano
nookasree ponamala wrote: Hi, I'm new to Python programming. I've changed the code to below, but still it is not working, Could you pls. make the corrections in my code. If you are to be a programmer, you need to learn how to read the error messages you get. You probably would have seen an er

Re: [Tutor] Need help with dates in Python

2011-03-09 Thread ian douglas
I'm new to the language as well, but I think you're missing your indentation after each of your 'if' conditions? On 03/09/2011 10:34 AM, nookasree ponamala wrote: if t< max: maxyr = max< should be indented if t> min:

Re: [Tutor] Need help with dates in Python

2011-03-09 Thread nookasree ponamala
maxyr = max if t > min: minyr = min t = (a,b,maxyr,minyr) tot.append(t) print t Thanks Sree. --- On Wed, 3/9/11, Andre Engels wrote: > From: Andre Engels > Subject: Re: [Tutor] Need help with dates in Python >

Re: [Tutor] Need help with dates in Python

2011-03-09 Thread Andre Engels
On Wed, Mar 9, 2011 at 9:21 AM, nookasree ponamala wrote: > Hi, > > I need help in finding the minimum date and maximum date in a file. > Here is my test file: > s.no:   dt1     amt     id1     id2 > 452     2010-02-20      $23.26      059542        06107 > 452     2010-02-05      $20.78      0595

Re: [Tutor] Need help with dates in Python

2011-03-09 Thread C.Y. Ruhulessin
import datetime min = datetime.date(2008, 1, 1) max = datetime.date(2012, 12, 31) file = open ('test2.txt','r') line = file.readline()[-1] while line: # your code 2011/3/9 nookasree ponamala > Hi, > > I need help in finding the minimum date and maximum date in a file. > Here is my test fil

[Tutor] Need help with dates in Python

2011-03-09 Thread nookasree ponamala
Hi, I need help in finding the minimum date and maximum date in a file. Here is my test file: s.no: dt1 amt id1 id2 452 2010-02-20 $23.26 05954206107 452 2010-02-05 $20.78 05954206107 451 2010-02-24 $5.99 05954220151