py2exe problem

Thomas Heller thomas.heller at ion-tof.com
Mon Jul 23 14:58:27 EDT 2001


"Jay Parlar" <jparlar at home.com> wrote in message news:1103_995913046 at jparlar...
> > Maybe there's a confusion: The -w command line flag to py2exe does NOT
> > specify a windows executable, it specifies an application
> > which runs in the windows _GUI_ subsystem - as opposed to the -c flag,
> > which creates a _console_ application.
> > For a wxPython app you would probably use the -w option, but if you
> > also print something to the console you need -c!
> >
> > (I should probably rename this command line option to --gui.)
> The problem is, that if I don't give it the -w switch, I get a runtime error.

The problem is, if you don't give the -w switch,
you will get the runtime error as well, but you probably cannot see it.

>
> Traceback <most recent call last>:
[Somehow the rest of the message didn't make it to c.l.p,
but arrived in private mail]
> .
> .
> .
>    File "win32com\server\register.pyc", line 105 in _find_localserver_exe
> "Runtime Error: Can not locate the program 'pythonw.exe' "
>
It seems you use the standard UseCommandline() function
from win32com.server in your script. This will not work
directly - as Duncan also has pointed out, I've posted
a working example. Here's the same article under
another URL: http://aspn.activestate.com/ASPN/Mail/Message/543305.

>
>
> > As Duncan Booth already suggested in his reply, it is generally
> > a good idea to start by building a commnd line version even if
> > you eventually will only be using a gui - you may not see
> > tracebacks or error messages otherwise.
> >
> Hehe, well, I can see that traceback now. Any suggestions? py2exe won't let me have both the -c and -w options at the same time.

You don't need them at the same time: You can run a GUI in the console
subsystem, but here you will always _have a console_ (sometimes called
the 'annyoing dos window'.

Thomas





More information about the Python-list mailing list