I'm using the following code to hide stderr on Linux/OSX for a Python library I do not control that writes to stderr by default:
f = open("/dev/null","w")
zookeeper.set_log_stream(f)
Is there an easy cross platform alternative to /dev/null? Ideally it would not consume memory since this is a long running process.
open(os.devnull)according to user stackoverflow.com/a/13944391/5267751 ■ if you want to redirect stdout there's a special solution stackoverflow.com/a/47419332/5267751