I was trying to create a dictionary with time stamp as the key.the code is :
>>> stamp = datetime.datetime(2012, 4, 12, 12, 26, int('13'))>>> new_dict = {}>>> new_dict[stamp] = 'one'>>> print new_dict {datetime.datetime(2012, 4, 12, 12, 26, 13): 'one'}>>> print stamp 2012-04-12 12:26:13
Why does it not take the key as '2012-04-12 12:26:13' and instead taking the expression 'datetime.datetime()' as the key?