Thanks for your reply, John.
I'll get back to you if I get stuck.

Regards,
Asrarahmmed


On 11/16/06, John Fouhy <[EMAIL PROTECTED]> wrote:

On 16/11/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote:
> Hi Folks,
>
>
> I have got a date (as string), time (as string) , number of slots (
integer)
> and delta ( which is in seconds).
> I want to create a dictionary which has got date as the key, and the
value
> should be a tuple with two elements (start_time, end_time).
>
> I will take start_time and find the end_time using delta. This pair of
start
> and end times have a corresponding date. The date will be used as the
key
> for the dictionary. Once the time crosses midnight, the date will
change.

Which part are you having trouble with?

To convert a string into a Date or Datetime object, use
time.strptime(), and then build a Datetime from the resulting
time_tuple.
(in Python2.5, I think, the datetime module has its own strptime()
function, which short-cuts this process)

--
John.




--
To HIM you shall return.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to