If I have a function that contains a lot of print statements:
ie.
def funA():
print "Hi"
print "There"
print "Friend"
print "!"
What I want to do is something like this
def main():
##funA() does not print to screen here
a = getPrint(funA()) ##where getPrint is some made up function/object
print a ##prints what funA would normally print at this step
So when funcA gets called it doesn't do any printing, instead it output to an object. I then print the object to get the result. Is there a way of doing this? I also do not want to touch the original function.
I hope it makes sense.