So on most modules I import, I can access the .__file__ attribute to
find the implementation. ie:[color=blue][color=green][color=darkred]
>>> import time
>>> time.__file__[/color][/color][/color]
'/data1/virtualpython/lib/python2.3/lib-dynload/timemodule.so'[color=blue][color=green][color=darkred]
>>> import socket
>>> socket.__file__[/color][/color][/color]
'/data1/virtualpython/lib/python2.3/socket.pyc'
This doesn't work on the "thread" module:[color=blue][color=green][color=darkred]
>>> import thread
>>> thread.__file__[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute '__file__'
A few questions. Why? Where is thread.py or thread.so? (I can't find
it).
thanks
matt
find the implementation. ie:[color=blue][color=green][color=darkred]
>>> import time
>>> time.__file__[/color][/color][/color]
'/data1/virtualpython/lib/python2.3/lib-dynload/timemodule.so'[color=blue][color=green][color=darkred]
>>> import socket
>>> socket.__file__[/color][/color][/color]
'/data1/virtualpython/lib/python2.3/socket.pyc'
This doesn't work on the "thread" module:[color=blue][color=green][color=darkred]
>>> import thread
>>> thread.__file__[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute '__file__'
A few questions. Why? Where is thread.py or thread.so? (I can't find
it).
thanks
matt
Comment