py2exe - return information from .exe program

Peter Hansen peter at engcorp.com
Tue Jan 28 19:41:27 EST 2003


Miranda Evans wrote:
> 
> Assume xyz.exe is a program that was produced from  xyz.py by running
> the py2exe utility.  Currently, xyz.exe displays information on the
> screen, but it does not return information to the calling program.
> Can xyz.py be modified so that xyz.exe returns a value (e.g. a string)
> to the process that called it?  Can anyone point me to a sample .py
> script which, when 'compiled' with py2exe produces a .exe that returns
> information to the calling program?  Thank you.

What is the "calling program" in this case?  Not all programs have
such a concept of "returned information", although by far the most 
common is simply to set a "result code" which is a simple integer
value.  For that, just use sys.exit(n) when you terminate the 
script.

-Peter




More information about the Python-list mailing list