[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Returns from exe



It looks like this uses subprocesses.  I don't think I'm currently using subprocesses.  I was wondering if you might be able to give a small piece of code using that module to show what you mean?

On 7/5/07, Dave LeCompte (really) <dave@xxxxxxxxxxxx> wrote:
"Ian Mallett" <geometrian@xxxxxxxxx> wrote:
> I was wondering if you can get returns from an executable somehow.
> Something like:
>
> import Objects
> def main()
>     objects = Objects.main()
>
> and Objects is an .exe file.
> Ian
>

Yep, the subprocess module makes that easy.

Check out

http://docs.python.org/lib/module-subprocess.html
http://docs.python.org/lib/node537.html

You'll be most interested in the returncode attribute.

-Dave LeCompte