Re: Python popen weirdness

Date : Tue, 27 May 2008 13:38:51 -0400
To : XSI(at)Softimage.COM
From : "Patrick Boucher" <pboucher(at)patrickboucher.com>
Subject : Re: Python popen weirdness
Not a fix 'per se' (is that how its written?) but I would definitely
suggest using the subprocess module instead of os.popen as that will
wind up being the preferred method in upcoming Python versions. If
you're just launching a win32 batch file you can look at the
subprocess.call helper.

Cheers,
Patrick

On Tue, May 27, 2008 at 1:15 PM, Alan Jones <skyphyr(at)gmail.com> wrote:
> Hi All,
>
> I've got a python module I call from within XSI that executes a batch
> script by calling os.popen
>
> process = os.popen(batchFilename)
>
> This doesn't actually execute unless I call process.readlines() -
> which would be fine, but then it executes twice.
>
> I can't get it to execute just once - even tried a single line
> process = os.popen(batchFilename).readlines()
>
> Anyone encountered this and know a fix. This will really shock people,
> but this is on win32.
>
> Cheers,
>
> Alan.
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.