Home     My Faqts     Contributors     About     Help    

faqts : Computers : Programming : Languages : Python

FAQTs repaired & updated!
Thanks for your patience...
Entry Add Entry Alert - Edit this Entry

Did You Find This Entry Useful?

16 of 24 people (67%) answered Yes
Recently 5 of 10 people (50%) answered Yes

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?

Sep 19th, 2000 21:23

unknown unknown, Rolf Freimuth
Mike Fletcher

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

© 1999-2004 Synop Pty Ltd