[Py2exe-users] how to build same executabl with and without console output

Gelonida gelonida at gmail.com
Fri Jul 30 15:27:48 EDT 2010


On 07/30/2010 11:00 AM, Jimmy Retzlaff wrote:
> On Fri, Jul 30, 2010 at 1:10 AM, Gelonida <gelonida at gmail.com> wrote:
>> What I'd like to achieve ideally is to create a py2exe program,
>> which
>> will only display a window (so 'compiled' as 'windows'-application) if
>> called normally.
>>
...
>>
>> Is there any way to compile the same python script (myprog.py) from one
>> py2exe script into once a 'windows' executable (myprog.exe) and once
>> into a 'console' executable (myprog_debug.exe)?
> 
> I can't think of an easy way to achieve the first approach - I've
> always taken the second approach. The advanced example included with
> py2exe has an example of how to do this. Look at all the occurrences
> of test_wx in the following link to see all the pieces involved:
> 
> http://py2exe.svn.sourceforge.net/viewvc/py2exe/trunk/py2exe/py2exe/samples/advanced/setup.py?view=markup
> 
> This uses an alternate form of the "windows" and "console" arguments
> where each target is an object with specially named member variables
> rather than a string that names the .py file (this string is one of
> the member variables). This is necessary so you can give different
> names to the console version and the windows version.
> 

Thanks, I'll read thorugh it.





More information about the Python-list mailing list