Esempio n. 1
0
def showfunc(f):
    "decompiles function"
    import decompyle
    if hasattr(f,'func_code'):
        # create the argument list
        argstr = "("
        argcount = 0
        for arg in f.func_code.co_varnames[:f.func_code.co_argcount]:
            argstr += arg
            argcount += 1
            if argcount < f.func_code.co_argcount:
                argstr += ","
        argstr += ")"
        print "%s%s" % (f.func_name,argstr)
        print "    Doc:",f.__doc__
        decompyle.decompyle(f.func_code)
Esempio n. 2
0
def showfunc(f):
    "decompiles function"
    import decompyle
    if hasattr(f, 'func_code'):
        # create the argument list
        argstr = "("
        argcount = 0
        for arg in f.func_code.co_varnames[:f.func_code.co_argcount]:
            argstr += arg
            argcount += 1
            if argcount < f.func_code.co_argcount:
                argstr += ","
        argstr += ")"
        print "%s%s" % (f.func_name, argstr)
        print "    Doc:", f.__doc__
        decompyle.decompyle(f.func_code)