I'm trying to stop a script from outputting text to the command line. It uses selenium in combination with chromedriver and chrome. I am using multiprocessing which could be relevant to the problem.
I've tried starting from command line in windows with this:
python foo.py 1>nul
This redirects stdout to nothing and works on my own print statements, but i still get output from chromedriver (or chrome). I have tried redirecting all the numerical handles from 0-9 but that doesn't help.
What can i do to silence the modules i am importing? I would prefer being able to remove the clutter while keeping my own ability to print to screen, but right now i'd take anything.
Output examples:
DevTools listening on ws://127.0.0.1:12818/devtools/browser/089e9b8d-66ce-431c-8486-abf1db2e1bc1
[10752:15088:1216/122840.419:ERROR:shader_disk_cache.cc(238)] Failed to create shader cache entry: -2
[27752:21264:1216/123032.960:ERROR:process_metrics.cc(105)] NOT IMPLEMENTED
I have also tried contextlib.redirect_stdout but this doesn't work on subprocesses and i spawn multiple via multiprocessing module.