import itertools
print itertools#ok
the code is ok
but i can’t find the itertools file.
who can tell me where is the ‘itertools file’
my code is run python2.5
import itertools
print itertools.__file__
Traceback (most recent call last):
File "D:\zjm_code\mysite\zjmbooks\a.py", line 5, in <module>
print itertools.__file__
AttributeError: 'module' object has no attribute '__file__'
The fact that the filename ends with
.someans it’s an extension module written in C (rather than a normal Python module). If you want to take a look at the source code, download the Python source and look intoModules/itertoolsmodule.c(you can also view it in your browser at http://svn.python.org/view/python/trunk/Modules/itertoolsmodule.c?view=log).Edit (as an answer to the comment below): it also works with Python 2.5: