Is there a way in Python to cat a string and a function?
For example
def myFunction():
a=(str(local_time[0]))
return a
b="MyFunction"+myFunction
I get an error that I cannot concatenate a 'str' and 'function' object.
There are two possibilities: If you are looking for the return value of
If you are looking for the name of
|
|||||
|
You need to call your function so that it actually returns the value you are looking for:
|
|||||
|
myFunction()
here? – Martijn Pieters Apr 18 at 16:17__name__
with myFunction and then concatenate them. (stackoverflow.com/a/255297/758446) – BlackVegetable Apr 18 at 16:19