One possible way would be to use Decorators :
def print_name(func, *args, **kwargs): def f(*args, **kwargs): print func.__name__ return func(*args, **kwargs) return f @print_name def funky(): print "Hello" funky()
The problem with this is that you will be able to print the name of the function before or after calling the actual function.
Actually, though, since you already define this function, could you just write the hard name in?
source share