I've written a nice chunk of code, and I'm looking to improve my verbose output. I had the idea of an if verbose: print '**** function_name ****'
at the start and end of the function and even defined a function to make it easier to call (I'm using the very sexy verbose print written by kindall here)
def verbwrap(function, side):
if side=='start':
verboseprint(' ****** %s ******' %(function))
if side=='end':
verboseprint(' ^^^^^^ %s ^^^^^^' %(function))
with the intention of using it like this:
import inspect
def test(lst):
verbwrap(inspect.currentframe().f_code.co_name,'start')
for i in lst:
print i
verbwrap('test', 'end') #equivalent to above, but easier to write :(
Is there a way for me to only call a re-worked verbwrap()
once? No amount of tinkering has led me to the answer!