[IronPython] IronPython 2.0 Alpha 6

Vizcayno vizcaynot at gmail.com
Sat Nov 10 01:21:33 CET 2007


I really have the next line:
from datetime.datetime import now, strftime
print now()
which works well in ipy 2.0 alpha4

So, as you kindly suggest, I will do:
from datetime import datetime
print datetime.now()

Thanks for your attention and help.
Regards.




On 9 nov, 19:58, Dino Viehland <di... at exchange.microsoft.com> wrote:
> Ahh, yes, it was a bug in IronPython that we fixed.
>
> The import x.y syntax expects x to be a module and y to be another module inside of that.  Maybe you want to use "from datetime import datetime" instead but that's different so maybe not :).
>
>
>
> -----Original Message-----
> From: users-boun... at lists.ironpython.com [mailto:users-boun... at lists.ironpython.com] On Behalf Of Vizcayno
> Sent: Friday, November 09, 2007 3:55 PM
> To: us... at lists.ironpython.com
> Subject: Re: [IronPython] IronPython 2.0 Alpha 6
>
> You are right Dino!! the same behavior happens in python 2.5. I
> suppose it is a bug.
> I also have this problem In ipy 2.0 alpha 6, but not in ipy 2.0 alpha
> 4.
> Very best regards.
>
> On 9 nov, 19:10, Dino Viehland <di... at exchange.microsoft.com> wrote:
> > Are you seeing something different on Alpha 6?  I see the same behavior between CPython and Python but I am on a slightly later build - although the list of methods is slightly different (e.g. no __getnewargs__ in IronPython).
>
> > -----Original Message-----
> > From: users-boun... at lists.ironpython.com [mailto:users-boun... at lists.ironpython.com] On Behalf Of Vizcayno
> > Sent: Friday, November 09, 2007 3:07 PM
> > To: us... at lists.ironpython.com
> > Subject: Re: [IronPython] IronPython 2.0 Alpha 6
>
> > Please, type the next:
>
> > import datetime.datetime
> > dir(datetime.datetime)
> > import datetime
> > dir(datetime.datetime)
>
> > The results in my winXP SP2 with python 2.5 are:
>
> > >>> import datetime.datetime
> > Traceback (most recent call last):
> >   File , line 0, in ##241
> >   File , line 0, in _stub_##2
> > ImportError: No module named datetime
>
> > >>> dir(datetime.datetime)
> > Traceback (most recent call last):
> >   File , line 0, in ##247
> > NameError: name 'datetime' is not defined
>
> > >>> import datetime
> > >>> dir(datetime.datetime)
> > ['__add__', '__class__', '__delattr__', '__doc__', '__eq__', '__ge__',
> > '__getattribute__', '__getnewargs__', '__gt__', '
> > hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__',
> > '__new__', '__nonzero__', '__radd__', '__reduce__', '__
> > duce_ex__', '__repr__', '__rsub__', '__setattr__', '__str__',
> > '__sub__', 'astimezone', 'combine', 'ctime', 'date', 'day'
> > 'dst', 'fromordinal', 'fromtimestamp', 'hour', 'isocalendar',
> > 'isoformat', 'isoweekday', 'max', 'microsecond', 'min', 'm
> > ute', 'month', 'now', 'replace', 'resolution', 'second', 'strftime',
> > 'time', 'timetuple', 'timetz', 'today', 'toordinal'
> > 'tzinfo', 'tzname', 'utcfromtimestamp', 'utcnow', 'utcoffset',
> > 'utctimetuple', 'weekday', 'year']
>
> > _______________________________________________
> > Users mailing list
> > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> > _______________________________________________
> > Users mailing list
> > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com-Ocultar texto de la cita -
>
> > - Mostrar texto de la cita -
>
> _______________________________________________
> Users mailing list
> Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> _______________________________________________
> Users mailing list
> Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -




More information about the Ironpython-users mailing list