How to find all submodules of module kazoo
>>> import kazoo
>>> import pkgutil
>>>
>>>
>>>
>>> dir(kazoo)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']
>>>
>>>
>>>
>>>#List all submodules of module kazoo
>>> for x in pkgutil.iter_modules(kazoo.__path__):
... x
...
(, 'client', False)
(, 'exceptions', False)
(, 'handlers', True)
(, 'hosts', False)
(, 'interfaces', False)
(, 'loggingsupport', False)
(, 'protocol', True)
(, 'recipe', True)
(, 'retry', False)
(, 'security', False)
(, 'testing', True)
(, 'tests', True)
>>>
>>>
>>>
>>> kazoo.client
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'client'
>>>
>>>
>>>
>>> import kazoo.client
>>> import kazoo.exceptions
>>> import kazoo.handlers
>>>
>>>
OR
>>>#List all submodules of module kazoo
>>> for x in pkgutil.walk_packages(kazoo.__path__):
... x
...
(, 'client', False)
(, 'exceptions', False)
(, 'handlers', True)
(, 'hosts', False)
(, 'interfaces', False)
(, 'loggingsupport', False)
(, 'protocol', True)
(, 'recipe', True)
(, 'retry', False)
(, 'security', False)
(, 'testing', True)
(, 'tests', True)
>>>
>>>
>>>
>>> import kazoo
>>> import pkgutil
>>>
>>>
>>>
>>> dir(kazoo)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']
>>>
>>>
>>>
>>>#List all submodules of module kazoo
>>> for x in pkgutil.iter_modules(kazoo.__path__):
... x
...
(
(
(
(
(
(
(
(
(
(
(
(
>>>
>>>
>>>
>>> kazoo.client
Traceback (most recent call last):
File "
AttributeError: 'module' object has no attribute 'client'
>>>
>>>
>>>
>>> import kazoo.client
>>> import kazoo.exceptions
>>> import kazoo.handlers
>>>
>>>
OR
>>>#List all submodules of module kazoo
>>> for x in pkgutil.walk_packages(kazoo.__path__):
... x
...
(
(
(
(
(
(
(
(
(
(
(
(
>>>
>>>
>>>
How to install Install Pygame
ReplyDelete#sudo apt-get update --fix-missing
#sudo apt-get build-dep python-pygame
#sudo apt-get install mercurial
#hg clone https://bitbucket.org/pygame/pygame
#cd pygame
#sudo python setup.py install
#virtualenv venv --system-site-packages
#source venv/bin/activate
#python -c "import pygame"