Checking wether something was printed Python

Viewed 53

Is there a way to check whether my python program printed something to a particular stream?

1 Answers

For python 3.x you can try

print('print this stuff')


import sys
sys.stdout.write('print this stuff')
Related