[Tkinter-discuss] Opening a .py that uses Tkinter on OS X pops open a console window

Kevin Walzer kw at codebykevin.com
Tue Mar 18 17:22:38 CET 2008


Jonathan Frankel wrote:
> When I put this code (using self.tk... instead of root.tk...) in the
> __init__ method I get an error:
> 
> AttributeError: App instance has no attribute 'tk'
> 

Here's my __init__ code:

class phynchronicityApp(Tk):

     def __init__(self, parent):
         Tk.__init__(self, parent)
         try:
             self.tk.call('console', 'hide')
         except TclError:
             pass
         self.masterlist = []
         self.makePrefsDir()
         self.registerHelpBook()
         self.makeImages()
         self.readPrefs()

What version of OS X/Python/Tk are you using?

-- 
Kevin Walzer
Code by Kevin
http://www.codebykevin.com


More information about the Tkinter-discuss mailing list