Re: Need Help comparing dates

2006-06-19 Thread colincolehour
The program works great! It does everything I wanted it to do and now I'm already thinking about ways of making it more useful like emailing me the results of my program. Thanks everyone for the help and advice. Colin Tim Chase wrote: > > I kept getting a Python error for the following line: > >

Re: Need Help comparing dates

2006-06-19 Thread Tim Chase
> I kept getting a Python error for the following line: > > month = m[webMonth] > > I changed it to month = month_numbers[webMonth] > > and that did the trick. Sorry for the confusion. Often when I'm testing these things, I'll be lazy and create an alias to save me the typing. In this case,

Re: Need Help comparing dates

2006-06-19 Thread colincolehour
I kept getting a Python error for the following line: month = m[webMonth] I changed it to month = month_numbers[webMonth] and that did the trick. Tim Chase wrote: > > I am new to Python and am working on my first program. I am trying to > > compare a date I found on a website to todays date.

Re: Need Help comparing dates

2006-06-17 Thread Tim Chase
> I will try to work through Tim's response. I tried using it > yesterday but I was really confused on what I was doing. I'll put my plug in for entering the code directly at the shell prompt while you're trying to grok new code or toy with an idea. It makes it much easier to see what is going

Re: Need Help comparing dates

2006-06-16 Thread colincolehour
Thanks for the reply, the book I'm actually using is Python Programming for the absolute beginner. The book has been good to pick up basic things but it doesn't cover time or dates as far as I can tell. As for previous programming experience, I have had some lite introductions to C & C++ about 6 ye

Re: Need Help comparing dates

2006-06-16 Thread John Machin
On 17/06/2006 9:55 AM, [EMAIL PROTECTED] wrote: > So when I grab the date of the website, that date is actually a string? Yes. Anything you grab off a website (or read from a file) will be held in a string. Typically you would then need to convert it (or parts of it) to some other type(s) e.g. i

Re: Need Help comparing dates

2006-06-16 Thread colincolehour
So when I grab the date of the website, that date is actually a string? How would I got about converting that to a date? -- http://mail.python.org/mailman/listinfo/python-list

Re: Need Help comparing dates

2006-06-15 Thread John Machin
On 16/06/2006 11:23 AM, Ben Finney wrote: > [EMAIL PROTECTED] writes: > >> I am new to Python and am working on my first program. I am trying >> to compare a date I found on a website to todays date. The problem I >> have is the website only shows 3 letter month name and the date. >> Example: Jun

Re: Need Help comparing dates

2006-06-15 Thread Ben Finney
Tim Chase <[EMAIL PROTECTED]> writes: > If you need to map the month-strings back into actual dates, you > can use this dictionary: > > >>> month_numbers = dict([(date(2006, m, 1).strftime("%b"), m) > for m in range(1,13)]) Or you can just use the same format codes to specify that time.strpti

Re: Need Help comparing dates

2006-06-15 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] writes: > > I am new to Python and am working on my first program. I am trying > > to compare a date I found on a website to todays date. The problem I > > have is the website only shows 3 letter month name and the date. > > Example: Jun 1

Re: Need Help comparing dates

2006-06-15 Thread Tim Chase
> I am new to Python and am working on my first program. I am trying to > compare a date I found on a website to todays date. The problem I have > is the website only shows 3 letter month name and the date. > Example: Jun 15 No year, right? Are you making the assumption that the year is the curr

Re: Need Help comparing dates

2006-06-15 Thread Ben Finney
[EMAIL PROTECTED] writes: > I am new to Python and am working on my first program. I am trying > to compare a date I found on a website to todays date. The problem I > have is the website only shows 3 letter month name and the date. > Example: Jun 15 The 'datetime' module in the standard library

Need Help comparing dates

2006-06-15 Thread colincolehour
I am new to Python and am working on my first program. I am trying to compare a date I found on a website to todays date. The problem I have is the website only shows 3 letter month name and the date. Example: Jun 15 How would I go about comparing that to a different date? The purpose of my progra