[Pythonmac-SIG] Console window appearing when running application bundled with py2app

Jens Thomas j.m.h.thomas at dl.ac.uk
Fri Jan 4 15:00:12 CET 2008


Ronald Oussoren wrote:
>  
> On Friday, January 04, 2008, at 12:37PM, "Jens Thomas" <j.m.h.thomas at dl.ac.uk> wrote:
>   
>> Hello,
>>
>> I've (finally) managed to get everything in place to build my 
>> python/vtk/Tk application as a universal binary and have py2app (0.3.6) 
>> successfully bundle it into an app.
>>     
>
> That's a Tk artifact on OSX. You can hide that window using a function like this:
>
> def hideTkConsole(root):
>     try:
>         root.tk.call('console', 'hide')
>     except Tkinter.TclError:
>         # Some versions of the Tk framework don't have a console object
>         pass
>
>
> This code is from IDLE. There are more Tk-on-OSX goodies in idlelib.macosxSupport.
>   
That's perfect - it does exactly what I was after.

Many thanks for the quick response.

Best wishes,

Jens


More information about the Pythonmac-SIG mailing list