A simple way to find out a Python module's location on your drive.
''' module_origin1.py Where does a given module come from? You could use module.__path__ but not all modules have a .pth file tested with Python27 and Python33 by vegaseat 22oct2013 ''' try: # Python2 import Tkinter as tk except ImportError: # Python3 import tkinter as tk import os print(os.path.dirname(tk.__file__)) ''' result (Python27) ... c:\python27\lib\lib-tk result (Python33) ... c:\python33\lib\tkinter '''
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.