Python Forum

Full Version: open /dev/null or equivalent, portably
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i would like to open a file to write to "/dev/null", or the equivalent, in a portable way. is there something that can cut this short and not even do the low level write but still look like an open file to code that does a basic test (not trying to fool exhaustive code)?
My search engine found os.devnull