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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -