I want to have a function that is output when it is executed separately, but returns the output when called by other functions, but does not output
for example, code similar to the following when directly executed:
def foo:
print 111
but it is executed when called by another function:
def foo:
return 111
This is about the meaning of . It is not very good at expressing it. To put it bluntly, it is an output function, but when called by other functions, it only returns the content of the calling function and does not output
.