Re: Date using input

2009-09-25 Thread Dave Angel
flebber.c...@gmail.com wrote: I don't think I am using re.compile properly, but thought as this would make my output an object it would be better for later, is that correct? #Obtain date def ObtainDate(date): date = raw_input("Type Date dd/mm/year: ") re.split('[/]+', date) date year = date[-1

Re: Re: Re: Date using input

2009-09-24 Thread flebber . crue
I don't think I am using re.compile properly, but thought as this would make my output an object it would be better for later, is that correct? #Obtain date def ObtainDate(date): date = raw_input("Type Date dd/mm/year: ") re.split('[/]+', date) date year = date[-1] month = date[1] day = date[0]

Re: Date using input

2009-09-24 Thread Sean DiZazzo
On Sep 24, 7:49 am, flebber wrote: > On Sep 24, 11:10 pm, flebber wrote: > > > > > On Sep 24, 10:58 pm, Dave Angel wrote: > > > > flebber.c...@gmail.com wrote: > > > > I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no > > > > class or instructor, I am learning this myself. I ha

Re: Re: Date using input

2009-09-24 Thread flebber . crue
Okay, thanks for the advice that sounds a good place to start. I used %2.os was an attempt to define width and precision to stop typo errors eg the user accidentally inputing 101/09/2009 or similar error. So that the __/__/ was adhered to. I will go back to the start get the basics happ

Re: Date using input

2009-09-24 Thread Dave Angel
flebber wrote: On Sep 24, 11:10 pm, flebber wrote: On Sep 24, 10:58 pm, Dave Angel wrote: flebber.c...@gmail.com wrote: I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no class or instructor, I am learning this myself. I have Hetlands book "Beginning Python

Re: Date using input

2009-09-24 Thread Tim Chase
Surely getting it tottally mixed up from datetime import date def ObtainDate(params): date = raw_input("Type Date dd/mm/year: %2.0r%2.0r/%2.0r%2.0r/%4.0r %4.0r%4.0r%4.0r") print date.datetime(year-month-day) By setting "date = raw_input(...)", you mask the datetime.date object preventing yo

Re: Date using input

2009-09-24 Thread flebber
On Sep 24, 11:10 pm, flebber wrote: > On Sep 24, 10:58 pm, Dave Angel wrote: > > > > > flebber.c...@gmail.com wrote: > > > I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no > > > class or instructor, I am learning this myself. I have Hetlands book > > > "Beginning Python Novice

Re: Date using input

2009-09-24 Thread flebber
On Sep 24, 10:58 pm, Dave Angel wrote: > flebber.c...@gmail.com wrote: > > I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no > > class or instructor, I am learning this myself. I have Hetlands book > > "Beginning Python Novice to Professional and online documentation > > books so

Re: Date using input

2009-09-24 Thread Dave Angel
flebber.c...@gmail.com wrote: I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no class or instructor, I am learning this myself. I have Hetlands book "Beginning Python Novice to Professional and online documentation books so Dive into Python, python.org etc. Using the SPE edi

Re: Re: Date using input

2009-09-24 Thread flebber . crue
I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no class or instructor, I am learning this myself. I have Hetlands book "Beginning Python Novice to Professional and online documentation books so Dive into Python, python.org etc. Using the SPE editor. I have currently only

Re: Date using input

2009-09-24 Thread Dave Angel
flebber wrote: Sorry to ask a simple question but I am a little confused how to combine the input function and the date time module. Simply at the start of the program I want to prompt the user to enter the date, desirably in the format dd/mm/year. However I want to make sure that python underst