beginner import confusion

DilbertFan steveb428pleaseremovethis at hotmail.com
Sat Apr 3 15:15:46 EST 2004


Hi,
 I really thought that I had this importing business down.

I recently downloaded and installed mx module for the DateTime class.

In IDLE, I go:

   import mx
   mx.DateTime.DateTime(2004)

   I get AttributeError: 'module' object has no attribute 'DateTime'

 but if you type:
    import mx.DateTime
    mx.DateTime.DateTime(2004)
   <DateTime object for '2004-01-01 00:00:00.00' at a979e0>

If you "import mx", like the first example, doesn't that get everything?

If you know, from the docs, that it contains a DateTime class and then a
DateTime object, and you specify the whole thing, why shouldn't that work?
 thanks for your patience
 Steve








More information about the Python-list mailing list