Python Concatenate String and Function -
is there way in python cat string , function?
for example
def myfunction(): a=(str(local_time[0])) return b="myfunction"+myfunction
i error cannot concatenate 'str' , 'function' object.
there 2 possibilities:
if looking return value of myfunction
, then:
print 'function: ' + myfunction()
if looking name of myfunction
then:
print 'function: ' + myfunction.__name__
Comments
Post a Comment