py2exe deal with python command line inside a program

im_smialing susan_kijiji at yahoo.ca
Sun Jan 24 19:14:37 CET 2010


Hi Jonathan,

Here is the traceback I got, 'test.py' is where "main" starts, and I
replaced 'sys.executable' with string 'python':

args: ['python', 'C:\\myscript.py']

Traceback (most recent call last):
  File "test.py", line 22, in <module>
  File "subprocess.pyc", line 594, in __init__
  File "subprocess.pyc", line 816, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified


On Jan 24, 6:28 am, Jonathan Hartley <tart... at tartley.com> wrote:
> On Jan 22, 7:35 pm, susan_kij... at 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?- Hide quoted text -
>
> - Show quoted text -




More information about the Python-list mailing list