On Jan 24, 6:35 am, Chris Rebert <c...@rebertia.com> wrote: > On Sun, Jan 24, 2010 at 3:28 AM, Jonathan Hartley <tart...@tartley.com> wrote: > > On Jan 22, 7:35 pm, susan_kij...@yahoo.ca wrote: > >> Hi, > > >> I need to create a python subprogress, like this: > >> myProcess = subprocess.Popen([sys.executable, 'C:\myscript.py'], > >> env=env, stdin=subprocess.PIPE, > >> stdout=subprocess.PIPE) > > >> sys.executable was printed out as ''C:\\Python25\\python.exe'', how > >> can I make this work in executable package through py2exe? > > >> I have to fix the following problems: > >> -Source code shouldn't exposed in an executable program > >> -Since python environment is not required when running an executable > >> program, how to deal with the situation that "C:\\Python25\ > >> \python.exe" is required as part of command? > > >> Thanks in advance! > > > Hi. What does it do when you try to execute it with py2exe? Does it > > fail to run? What is the error? > Thanks for pointing that, this time I try to use 'python' as the arg, I got an error: WindowsError: [Error 2] The system cannot find the file specified
Because the subprocess is looking for a source code location, and which was hard coded, any suggestion to work out the issue? > The subprocess call would fail utterly since sys.executable is > apparently inaccurate for py2exe-generated executables. > > Cheers, > Chris > --http://blog.rebertia.com- Hide quoted text - > > - Show quoted text - -- http://mail.python.org/mailman/listinfo/python-list