>>>>> Visco Shaun <visc...@gmail.com> (VS) wrote:

>VS> http://docs.python.org/library/logging.html
>VS> While going thr' the above link i came across import statements 
>VS> "import logging
>VS> import logging.handlers"

>VS> What is the use of second import as the first import will be
>VS> enough(AFAIK) to access anything intended by the second import?
>VS> Is there any kind of advantage?

Have you tried?

>>> import logging
>>> logging.handlers
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'handlers'
>>> import logging.handlers
>>> logging.handlers
<module 'logging.handlers' from 
'/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/logging/handlers.pyc'>
>>> 

'logging' is a package. The 'logging' module does not contain a
definition of 'handlers' but there is a module 'handlers' in the 'logging'
directory.
-- 
Piet van Oostrum <p...@cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to