Thanks Thomas, I wasn’t aware of pynsist. I will check it out.
Wayne
From: Thomas Kluyver [mailto:tak...@gmail.com]
Sent: Tuesday, October 7, 2014 1:35 PM
To: primary discussion list for use and development of cx_Freeze
Subject: Re: [cx-freeze-users] Calling python from frozen exe
On 7 October 2014 10:11, Wayne Boras
<wayne.bo...@lethbridge.ca<mailto:wayne.bo...@lethbridge.ca>> wrote:
Is it possible to call the bundled python interpreter from within a frozen exe?
I need to call a third-party py file which is designed to run from the command
line, not natively using import statements.
Besides what Owen suggested, you could also use a trick like multiprocessing
does with its freeze_support() function [1]. In that case, you'd launch your
subprocess using sys.executable, like when running unfrozen, but as your
application starts up, check for a particular command line argument, which
tells it to do something other than launching your application. In your case,
that would be running the third party Python script.
This is also something where my alternative tool, Pynsist [2], might be easier.
Because it doesn't freeze your code, sys.executable points to a regular Python
interpreter, and you don't need any special handling to run a Python subprocess.
[1]
https://hg.python.org/cpython/file/1e1c6e306eb4/Lib/multiprocessing/spawn.py#l62
[2] http://pynsist.readthedocs.org/en/latest/
Thomas
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
cx-freeze-users mailing list
cx-freeze-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users