Doing a math function of the type def.
def integral_error(integral,f):
------stufff-------
print integral
gives something like: '<function simpsons at 0xb7370a74>'
is there a way to get just simpsons without string manipulations? ie just the function name?
You can use:
integral.func_name
Or:
integral.__name__
Though, they are exactly equivalent. According to docs:
__name__is Another way of spelling func_name
Here's a sample code:
>>> def f():
pass
>>> f.__name__
'f'
>>> f.func_name
'f'
>>>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With