Redirect question

Pierre Rouleau pieroul at attglobal.net
Sun Nov 17 15:07:58 EST 2002


Karsten Weinert wrote:
> Hi,
> I have a question about redirecting. Here is a small program I found
> on the web which I slightly modified; but now it does not run:
> 
> import win32ui, sys
> 
> class Redirect:
>   def __init__(self):
>     self.s=""
>   def write(self, s):
>     self.s+=s
>   def flush(self):
>     win32ui.MessageBox(s)
> 
First, you must use the right variable.  s is nothing.  self.s is the 
right variable.

def flush(self):
    win32ui.MessageBox(self.s)

Then, check if your pop up window is buried under some other windows.
On my system if i execute
	win32ui.MessageBox("some message")
it works fine but the message box does not have the focus, it is not 
listed in the list of processes (i tried it on NT) and the only way
to see the message box is to hide all other windows.

Hint:
	hit <Window-key><M>  to hide all windows.
	hit <Window-key><shift><M> to restore all windows.



-- 
         Pierre




More information about the Python-list mailing list