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

2010-07-30 Thread Gelonida
On 07/30/2010 11:00 AM, Jimmy Retzlaff wrote:
> On Fri, Jul 30, 2010 at 1:10 AM, Gelonida  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.


-- 
http://mail.python.org/mailman/listinfo/python-list


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

2010-07-30 Thread Gelonida
Hi,

On 07/30/2010 03:51 PM, Dave Angel wrote:
> pyt...@bdurham.com wrote:
>>> Is there any trick in adding a console window to an application, that
>>> was built as 'windows' application?
,,,
>>> Since we're talking MS Windows here, see:
> 
> http://msdn.microsoft.com/en-us/library/ms682528(VS.85).aspx
> 
> You can access the AllocConsole and related functions with the win32
> module:
>   win32console
> 
> This module is part of the win32 extensions, and also part of
> ActivePython distribution.
> 
Thanks a lot for  your answer
I'll check this out.



-- 
http://mail.python.org/mailman/listinfo/python-list


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

2010-07-30 Thread Dave Angel

pyt...@bdurham.com wrote:

Is there any trick in adding a console window to an application, that was built 
as 'windows' application?



I was recently wondering the same thing myself. My research indicates
that its not possible to have a single Windows application that can run
in both console and GUI ("Windows") modes.

Here are 2 links that explain this in more detail.




Malcolm

  

Since we're talking MS Windows here, see:

http://msdn.microsoft.com/en-us/library/ms682528(VS.85).aspx

You can access the AllocConsole and related functions with the win32 module:
  win32console

This module is part of the win32 extensions, and also part of 
ActivePython distribution.


DaveA

--
http://mail.python.org/mailman/listinfo/python-list


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

2010-07-30 Thread python
> Is there any trick in adding a console window to an application, that was 
> built as 'windows' application?

I was recently wondering the same thing myself. My research indicates
that its not possible to have a single Windows application that can run
in both console and GUI ("Windows") modes.

Here are 2 links that explain this in more detail.




Malcolm
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2010-07-30 Thread Jimmy Retzlaff
On Fri, Jul 30, 2010 at 1:10 AM, Gelonida  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.
>
> however if being called with the option --debug it should display the
> graphical window plus a debug console where I can print to.
>
> Is there any trick in adding a console window to an application,
> that was built as 'windows' application?
>
> If above is not possible:
>
> 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.

Jimmy
-- 
http://mail.python.org/mailman/listinfo/python-list