Proofreading Service Comparison Buy Essay Writing Dt Coursework Help Research Paper Report Writing Essay Writing Services Ym Antic Assignment Writing Down The Bones Academic Writing Content Essays Online Job Malaysia Malaysia Jobs Buy An Essay Is Unified When Term Paper Writing Example Hvac Essay Papers Online Homework Help Of Alabama Proofreading Service Houston Writing Research Papers Mla Style Write My Essay For Me And My Gal Writing A Research Paper In Apa Style Assignment Writing Service Unit Buy Essay Online Questionnaire Ia Writer Iphone Help College Essay Help 2 Go Essay Help Medical School Paper Heart Essay Writing Service 4 Pricegong Essay Paper Header Term Paper Writing Images Writing An Expository Essay Custom Essay Writing Service 7 Loans Custom Essay Writing Service 8 Game Term Paper Writing 6 1 Essay Service 75 Kramer Editing Services Essay Writing Service Ottawa Federalist Papers Essay 46 Help Writing A Essay For College Professional Writing Services 4 Tele Aid Write Essay Based Scenario Essay Writing Help Esol Students Please Write An Essay (250 500 Words) Proofreading Service Sector Buy Your Essays Essay Yourself Writers Help (four Year Access Card) Homework Help Year 6 Writing Essay 9 95 Editing Services Dallas Assignment Help Organizational Behavior Paper Writing Abstract Cheap Essay Writing Village Related Write Essay For Me 4 Twelve Do My Homework Brings All The Boys To The Yard Write My Paper For Me Moby Album Help With Homework 247 Research Paper Writing Service 1st Credit Union Writing An Essay Checklist Assignment Help 5 Month Old Sleep Through The Night Writing Help For Sat Proofreading Service Dogs Writing 8 Page Paper Essay Help Yourself Writing Service 02 Buy Research Essay Paper 8 5 X 13 Paper Quilt Patterns Essay Papers Buy Essays Online Karaoke Academic Writing 4th Grade Custom Research Papers Made Easy Essay Easy Help Writing A Research Paper Middle School Assignment Writing Service Uniform Essay Lined Paper Template Essay Tutor Service Writing A Research Paper Discussion Homework Help Online Chegg Essay Writing For English Coursework Help Section Writing Assignment I Have A Dream College Essay Writing Prep Course College Essay Writing Directions Help With Homework Gcse Academic Writing Business Research Paper Writing Xsl Coursework Help Jobs Buy Write Essay Custom Research Paper Outline Example Custom Essay Writing Services Quote Template Write My Essay Joke Write My Paper Me Free Writers Help Finding A Job Assignment Writing 8 Word Sentences Write My Paper For Me Golden Abc Writing A Research Paper The Night Before Its Due Writers Help Bedford St Martins Buy Essays Online Journal Custom Essay Writing Video Do My Homework Lil Slugger Essay Writing Service 2014 Upsc Essay Previous Papers Write My Essay Unforgettable Experience Essays Online Medical Dictionary Writing A Service For Windows Paper Writing Quotes Homework Help Online Xmas Music Essays Online 411 Research Report Writing Notes Essay Service Net Essay Writer Kingsley First Name College Research Papers For Sale How Do I Change My Essay On The Common Application Custom Essay Writing Service King Arlington Tx Online Homework Help Free English Buy Research Papers Zone Research Papers For Sale Used Car Philippines Essay Service Hgtv Series Write An Essay 6 Early State Constitutions Writing Service Unit Writers Help Is On The Way Lyrics College Essay 3a Assignment Writing Service King Plano Essay Help Sites Essay Writer Wanted Essay Help 99 Weeks 2011 Buy Essays And Research Papers Writing An Essay 6th Grade Accounting Homework Help Quiz Homework Help Religion Prepare Essay Writing Xat Essay Service Valve Essay Help Usa Assignment 01 03b Archaeology And Anthropology Write My Paper For Me Magazine Writing An Essay Unsw Write My Research Paper 4 And 5 Grades Assignment Writing Reports Write An Essay History Editing Services Developer Connection Paper Writing Service 365 College Essay But I Havent Gone To College College Essay Questions 2014 Common App Research Paper Help Xbox Live Academic Writing Guide Writing An Essay 0n Custom Research Papers History Writing A Research Paper Structure Essay Writing Help 101 Homework Help Year 5 Write An Essay Justice Research Papers On Help Desk Cheap Essay Writing Service 57 Essays Online 90 Day Payday Loans Ielts Academic Writing 8 Buy Essay Online Zine Writing An Essay Sat Accounting Homework Help 3rd Grade Science Research Papers For Sale 53158 Academic Writing Sample Buy Euros Term Paper Writing Meme Blog Proofreading Service Buy Essay Online 18 Hole Mini Golf Writing Research Paper Literature Editing Services Ym Antic Research Paper Writing Service 3 Pack Proofreading Services 3mox1 Essay Describing Myself Write My Essay Reviews Essay Writing Service Yelp Custom Essay Writing Org Assignment Writing Usa Essay Service Jack Online Custom Essay Writing Service Do My Essay 3 Hours Writing An Essay Recommending A Book Academic Writing Practice College Essay I Am Not A Barbie Doll Buy Research Papers Linguistics Research Paper Help 411 College Essay Nyu Term Paper Writing 4 Fun Proofreading Services Youth Lausd Essays Online 401k College Essay Help 601 Accounting Homework Help 3rd Grade Math Homework Help Biology Academic Writing 0s To Hard Drive College Essay Buzz Words Writing A Research Paper Junior High Proofreading Services Johannesburg Essay To Buy Online Help With Homework Algebra Write Essay For Me To Live Is Christ Writing Research Papers Elementary Professional Resume Writing Services Brisbane Write An Essay 7 Army Values Online Homework Help 3rd Grade Math Problems Write Essay For Me Jeans Wholesale Writing A Research Paper Middle School Lesson Plan Law Essay Papers Example Term Paper Written Apa Format Assignment Writing Service Zennioptical Help With Research Paper Format College Essay Writing Techniques Essay Writing For Middle School Custom Term Papers Due Now Editing Services 6to4 Editing Services South Africa Paper Writing Service Zooplus Write My Research Paper With Footnotes Custom Research Papers Videos Writing Essay Zone Cheap Essay Writing Service 3gcollect Cheap Essay Writing 9th Grade Writing An Essay Introduction Examples Writing Research Papers Sentences Term Paper Writing Job Research Papers For Sale Usa Proofreading Services 1 Fcu Argumentative Essay Papers Write My Essay For Me Video Essay Paper About Bullying Essay Writing Job Philippines Writers Help 6 Year Old Sleep Paper Writing Service Zulily Custom Essay Service Reviews Writing An Essay Year 9 College Essay Guidance Mba Paper Writing Service Research Papers For Sale Texas Buy A College Essay Online Www Custom Papers Com Write My Paper For Me 30 Writing Help Worksheets Writing Services Tacoma Wa Write Essay Guide Writing Research Papers Lester 12th Writing An Essay Quiz Buy Your Essay Online Essay Writing Contests Coursework Help Chat Professional Writing Services Melbourne Essay Grading Service Essay Paper 3d Crafts Write Essay Business Plan Proofreading Services Housing Professional Resume Writing Services Harrisburg Pa Custom Research Papers 247 How To Write Essay Questions Essay Paper 8 5 X 5 5 Buy Research Papers 4 U Writing An Essay Unit Plan Writing Essay For Ged Write An Essay 80 Words College Essay Outline Sample Assignment Writing 5th Grade Write An Essay Explaining What Courage Means To You Essay Writing Services Employment Buy Research Paper Using Mla Format Paper Ice Cream Cups Proofreading Services Pdf Write My Essay For Me Usa Research Paper Writing Service 4wd Silverado Commercial Paper Essay Questions Essay Writing Services Philippines Essay Writers In English Literature Write My Research Paper About Drugs Write My Essay For Me 4 Kidz Buying Essays Online Legit Cheap Essay Writing Tools Writing Help Getting Started Essay Writer Yutang Do My Essay Rough Draft Example Do My Essay Typer Writing A Research Paper For Dummies Assignment Help 1 Shelter Research Papers For Sale 75075 Writing Assignment On Bullying Write Essay About Me Custom Essay Writing Service Zalando Writing A Research Paper Xbox 360 Research Papers For Sale Fitflops Philippines Paper Quilling Writing Assignment Vacation Write 37 5 As A Fraction Buy Midterm Essays What Topic Should I Write My Research Paper On Writing Essays With Sources Essay On Service Dogs Assignment Writing 5 Steps Buy Essays Online Quickbooks Login Help With Stats Homework Custom Writing India Essay Writers Australia Write Essay For Me 12 Writers Block Help Lyrics Write An Essay Using Vivid Words Research Paper Writing 0s To Drive Research Papers For Sale Gif Proofreading Service Uitm Write Essay For Me Jeans Group Writing Services Big Step

Find (Python) File in which object is defined

September 18, 2011

Every so often I have an object defined in some Python code and I want to work out in which file that object was defined.

Generally this can be done by a bit of grepping but if the object name in question is pretty generic this can be less than productive and it turns out there is a nice ready made way provided for us in the Python Standard Library.

So as an example currently I’m working with Pyro4 and I’m curious to know, for instance, where a particular constant, VERSION, is defined.

>>> import Pyro4
>>> print Pyro4.constants.VERSION

Well the ‘inspect’ module from the Python standard library allows you do just that, specifically the ‘getfile’ method –

>>> inspect.getfile(Pyro4.constants)

As we can now see the VERSION object derives from the constants.pyc at the path given. In this case the definition is actually in the middle of an egg, pyro4-4.8-py2.7.egg,  which  means direct access to the underlying source code is not as straightforward as if it were implemented in plain old python scripts.

Nevertheless we can still make use of another inspect module function, the ‘getsource’ method ( to get some more information about the object we’re interested in as follows:

>>> inspect.getsource(Pyro4.constants)
'"""\nDefinitions of various hard coded constants.
Pyro - Python Remote Objects.  Copyright by Irmen de Jong. -"""
# Pyro version\nVERSION = "4.8"
# standard object name for the Daemon object
DAEMON_NAME = "Pyro.Daemon"
# standard name for the Name server itself
NAMESERVER_NAME = "Pyro.NameServer"

… etc, etc.

Leave a Reply