Re: [BangPypers] Finding methods in a python script

2008-03-13 Thread Anand Balachandran Pillai
Here is a full program. """ List classes, methods, functions and function/method args in a module Created: Anand B Pillai """ from types import * import inspect def analyze_func(obj, method=False): if method: print 'Method: %s' % obj.__name__ else: print 'Function: %s'

Re: [BangPypers] Finding methods in a python script

2008-03-13 Thread Seshadri_N
In addition to all the nice tips provided earlier... my 0.2cents ! If your module has doc strings then you can use something like: ~ import os help(os) ~ -- seShadri -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pradeep Kisho

Re: [BangPypers] Finding methods in a python script

2008-03-13 Thread Chirayu Patel
Heshan, You will find http://docs.python.org/lib/inspect-types.html helpful. "A.__dict__["foo"].func_code.co_varnames" will give you arguments of foo. CP On 3/13/08, Heshan Suriyaarachchi <[EMAIL PROTECTED]> wrote: > > Hi >I am talking about a scenario like this > > class A: > def foo(v

Re: [BangPypers] Finding methods in a python script

2008-03-13 Thread Pradeep Kishore Gowda
Ah! i forgot about the function parameter list.. Will look into it. +Pradeep On 3/13/08, Pradeep Kishore Gowda <[EMAIL PROTECTED]> wrote: > On 3/13/08, Heshan Suriyaarachchi <[EMAIL PROTECTED]> wrote: > > Hi > > >I am talking about a scenario like this > > > > class A: > > def foo(var

Re: [BangPypers] Finding methods in a python script

2008-03-13 Thread Pradeep Kishore Gowda
On 3/13/08, Heshan Suriyaarachchi <[EMAIL PROTECTED]> wrote: > Hi >I am talking about a scenario like this > > class A: > def foo(var1,var2): > return 'Hello' > def echo(): > return 'testing' > > > class B: > def bar(car): > val = car > return car >

Re: [BangPypers] Finding methods in a python script

2008-03-13 Thread Heshan Suriyaarachchi
Hi I am talking about a scenario like this class A: def foo(var1,var2): return 'Hello' def echo(): return 'testing' class B: def bar(car): val = car return car What I need is to find out the classes and the methods of each class with their paramete