On Mon, Jun 27, 2011 at 11:47 PM, Andrew Berg <bahamutzero8...@gmail.com> wrote:
> On 2011.06.28 01:32 AM, Peter Otten wrote:
>> >>> subprocess.call(["ls"], stdout=open(os.devnull, "w"))
>> 0
> D'oh! Not sure why I was thinking os.devnull was a file object. :-[

On the bright side, I think in part due to this /exact/
misunderstanding, in bleeding-edge Python v3.3 you can now write:
>>> subprocess.call(["ls"], stdout=subprocess.DEVNULL)

http://docs.python.org/dev/library/subprocess.html#subprocess.DEVNULL

Cheers,
Chris
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to