Portable /dev/null?

Josiah Carlson jcarlson at nospam.uci.edu
Tue Jan 27 18:03:32 EST 2004


Nicolas Fleury wrote:

> Hi everyone,
>     Is there an object in some standard library that would be the 
> portable equivalent of "file('/dev/null','w')" or do I have to create my 
> own class and object to do it?  If it doesn't exist, do you think it 
> would be a good idea to have such an object in a standard library?
> 
> Thx and Regards,
> 
> Nicolas
> 

In Windows you can open the file 'NUL' and it will work the same as 
'/dev/null' in *nix.

  - Josiah



More information about the Python-list mailing list