import sqlite3

Andrew McNamara andrewm at
Thu Jun 4 02:33:23 EDT 2009

On 04/06/2009, at 4:14 PM, willgun wrote:

>> What did you call the .py file? If so, you've just  
>> imported your own module again. 8-)
>> After the import, try "print sqlite3.__file__", which will tell you  
>> where the module came from.

> Thank you all the same.
> I'm a student from China.It's painful for us to read python  
> documentation entirely due to poor english.So I often make these  
> mistakes.

Don't worry - even experienced Python coders get caught by this one.  
Just remember the "print module.__file__" trick for next time  
something odd happens.

When you import a module in python, it is only imported the first time  
you request it (which is why your import did not become recursive and  
raise an error). 

More information about the Python-list mailing list