Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #42780

Re: Python 3.3 Tkinter Fullscreen - Taskbar not Hiding

From Rotwang <sg552@hotmail.co.uk>
Newsgroups comp.lang.python
Subject Re: Python 3.3 Tkinter Fullscreen - Taskbar not Hiding
Date 2013-04-04 23:21 +0100
Organization A noiseless patient Spider
Message-ID <kjku8c$pr6$1@dont-email.me> (permalink)
References <d6635af4-7a4a-4aeb-8eaf-4b13dee7c003@googlegroups.com> <mailman.101.1365083379.3114.python-list@python.org> <kjkd73$ooq$1@dont-email.me> <mailman.112.1365102055.3114.python-list@python.org>

Show all headers | View raw


On 04/04/2013 20:00, Jason Swails wrote:
> On Thu, Apr 4, 2013 at 1:30 PM, Rotwang <sg552@hotmail.co.uk
> <mailto:sg552@hotmail.co.uk>> wrote:
> [...]
>
>     I don't know whether this applies to the OP's code, but I can think
>     of at least one reason why one would want both "import module" and
>     "from module import*" at the top of one's code: monkey patching.
>
>
> That was not happening in the OP's code (it actually had no references
> to tkinter after the initial import).

Sure.


> That said, if you change any
> attributes inside tkinter (by binding names inside tkinter to another
> object) after the top three lines, those changes will not percolate down
> to the attributes imported via "from tkinter import *" -- you would
> obviously have to do that work before importing the tkinter namespace
> into the toplevel namespace.

What I had in mind was something like this:

# begin module derp.py

global_variable = 4

def f():
	print('global_variable == %i' % global_variable)

# end module derp.py

 >>> # in the interactive interpreter...
 >>> import derp
 >>> from derp import *
 >>> global_variable = 5
 >>> f()
global_variable == 4
 >>> derp.global_variable = 5
 >>> f()
global_variable == 5


Off the top of my head I don't know whether there's any purpose to doing 
that kind of thing with tkinter, but I can conceive that it might be 
useful for e.g. changing widget default behaviour or something.


> I'd be interested to see if there's actually an example where someone
> does this in a way that would not be done better another way.

No idea, sorry.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python 3.3 Tkinter Fullscreen - Taskbar not Hiding teslafrequency@aol.com - 2013-04-03 20:45 -0700
  Re: Python 3.3 Tkinter Fullscreen - Taskbar not Hiding Jason Swails <jason.swails@gmail.com> - 2013-04-04 09:49 -0400
    Re: Python 3.3 Tkinter Fullscreen - Taskbar not Hiding Rotwang <sg552@hotmail.co.uk> - 2013-04-04 18:30 +0100
      Re: Python 3.3 Tkinter Fullscreen - Taskbar not Hiding Jason Swails <jason.swails@gmail.com> - 2013-04-04 15:00 -0400
        Re: Python 3.3 Tkinter Fullscreen - Taskbar not Hiding Rotwang <sg552@hotmail.co.uk> - 2013-04-04 23:21 +0100
  Re: Python 3.3 Tkinter Fullscreen - Taskbar not Hiding teslafrequency@aol.com - 2013-04-04 10:31 -0700

csiph-web