GUI2Exe - Change Python version?

Hi,

I really like Andrea's GUI2Exe application. It's made it extremely easy
for me to refine my distributions on our network. However, I would like
the capability to choose which Python version it "compiles" against since
I use both Python 2.4 and 2.5 here at work. Is there a way to do that?

Thanks,

Mike Driscoll
Applications Specialist
MCIS - Technology Center

Hi Mike,

Hi,

I really like Andrea's GUI2Exe application. It's made it extremely easy
for me to refine my distributions on our network. However, I would like
the capability to choose which Python version it "compiles" against since
I use both Python 2.4 and 2.5 here at work. Is there a way to do that?

Sorry for the late reply, I took a long holiday :smiley:

I have never used multiple (concurrent) Python versions on the same
machine, but it looks to me you just need to change the PATH system
variable to make your PC aware on where "python.exe" lives. So, for me
at the moment, the console command "python" just invokes
C:\Python25\python.exe. If the Python versions switch is as easy as
that (which I am not sure of), it would be easy to add a menu option
in GUI2Exe to modify the PATH variable to choose the Python version
you want, although I am a bit reluctant about adding a feature which
modifies a system-wide variable...
I am probably missing something about this Python version switch, so
if someone could explain how to better deal with concurrent Python
versions on the same PC I would be glad to add this option to GUI2Exe.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Jan 2, 2008 7:22 PM, Mike Driscoll wrote:

Hi Aaron

> From: Andrea Gavana [mailto:andrea.gavana@gmail.com]
> Sent: Wednesday, January 09, 2008 3:56 PM
>
> machine, but it looks to me you just need to change the PATH system
> variable to make your PC aware on where "python.exe" lives. So, for me
> at the moment, the console command "python" just invokes
> C:\Python25\python.exe. If the Python versions switch is as easy as

Does GUI2Exe work by invoking a local Python instance on your distro.
machines? Or does it include Python zipped into the EXE? That is, do you
want to vary the Python version at compile-time or at run-time?

When compiling a Python script to an executable (in the same way
py2exe works), GUI2Exe simply calls as an external process the
following lines of code:

# Build the compilation command
cmd = 'python -u "%s" %s %s'%(tmpFileName, self.compiler, dryRun)

# Start the process, redirecting the output to catch stdio
self.process = wx.Process(self.MainFrame)
self.process.Redirect()

# We want the process to be asynchronous
self.pid = wx.Execute(cmd, wx.EXEC_ASYNC, self.process)

So, if Mike uses the Python source code of GUI2Exe (and I believe he
does), there is no Python version bundled with it which could
interfere with this external process call (as far as I can see). So, I
am not sure on what I should do to make the Python version Mike wants
the current one for the external process.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Jan 9, 2008 11:02 PM, Aaron Brady wrote:

> -----Original Message-----