I
Igor Mikushkin
Hello all!
Could anyone please say me what is the right way to handle broken
pipes in Python?
I can wrap all my print statements with try/except blocks but it looks
like overkill for me.
I'm using my Python script this way: my_script | less
The script produces a lot of data.
So usually when I find what I'm looking for and press 'q' script is
still writing something.
Thanks in advance,
Igor
Could anyone please say me what is the right way to handle broken
pipes in Python?
I can wrap all my print statements with try/except blocks but it looks
like overkill for me.
I'm using my Python script this way: my_script | less
The script produces a lot of data.
So usually when I find what I'm looking for and press 'q' script is
still writing something.
Thanks in advance,
Igor