write some code need redirect_stdout,
rd,wr=redirect_stdout()
print("xx")
println("\n")
readavailable(rd) ---->ok
readavailable(rd)---->blocked here
the question is sometimes I don't know whether there are output in buffer or not, so readavailable will block .
how to avoid blocked when read from pipe when don't know output is null or not ?