Thanks for the clarification.
Cheers, Brandon
On Dec 17, 2006, at 8:55 AM, Alex Holkner wrote:
Brandon N wrote:
No, this is normal for Python -- you must import a module to use it (not just its package). Pygame actually does a trick with its sub- modules, which is probably what's causing the confusion. For example, you can doThanks, that seems to be the solution.
Interestingly, perhaps this is a Python feature that I am unaware of but this seems strange to me:
>>> import ctypes >>> ctypes.util.find_library Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'module' object has no attribute 'util' >>> from ctypes.util import find_library >>>
Is there something unique about the util module in ctypes?
import pygame pygame.display.something(...)
This works because in pygame/__init__.py is something along the lines of:
import pygame.display
which brings "display" into the module namespace. Most packages I know of don't do this trick -- you must import the packages you want explicitly.
Cheers Alex.