faqts : Computers : Programming : Languages : Python

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

31 of 42 people (74%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How do I get the full pathname of a module? Let's say I use 'import' to load a module. How can I find the location of its *.py or *.pyc file?

Nov 30th, 2004 10:28
Chris Burkhardt, Joe Bloggs, unknown unknown, Rolf Freimuth,


def modulePath( module ):
        import os
        return os.path.abspath( module.__file__ )