Unanswered Questions in python.faqts.com

Richard Chamberlain richard_chamberlain at ntlworld.com
Tue Aug 22 02:47:04 EDT 2000


Hi Fiona,

> From within a function, is there a way to determine what the parent of a
> calling widget is?

from Tkinter import *
root=Tk()
frame=Frame(root)
button=Button(frame,text='Click Me')
button.pack()
frame.pack(fill=BOTH,expand=1)
def clicker(event):
    event.widget.master.configure(bg='blue')
button.bind('<Button>',clicker)
root.mainloop()

I presume this is what they mean. If you bind an event you have access
to the calling widget via event.widget, so you have access to the
calling widget's parent via event.widget.master.

> How do I perform an os.popen() on NT?
> http://www.faqts.com/knowledge-base/view.phtml/aid/5396/fid/244/lang/

os.popen is broken on Windows platforms, instead you want to use
win32pipe module from the win32 extensions.

import win32pipe
popen=win32pipe.popen('echo A Norwegian blue')
popen.read()
'A Norwegian blue\012'

I expect this is fixed in 1.6/2.0 although I haven't looked.

>>Can I make something like a jTable in Tkinter

A jTable is a very powerful widget enabling you to have graphics and
text in each cell. At the moment there isn't anything like that in Tk.
The closest you would come is if you created a window filled with
canvases, or just entries if you were only interested in text. You would
find an issue with the number of widgets and speed, so you would have to
find a way to only display those widgets that were currently onscreen.
All in all not very practical. Two solutions spring to mind, (a) use
wxPython they have a nice wxGrid control or (b) See what the next
release of either tcl/tk brings.

Richard




Fiona Czuczman wrote:
> 
> Hi Guys,
> 
> Today I went through the faqts python knowledge base and found 13
> unanswered questions.  Considering there are 751 answers and 824
> questions (some answers have more than 1 question associated with them)
> that's not too bad, but it's still not ideal.  My aim is to maintain a
> useful resource!
> 
> Some of these questions may have come up in the newsgroup recently and
> I've missed them :-(
> 
> If anyone can shed some light on the below questions that would be
> great.
> 
> thanks,
> 
> Fiona
> 
> FAQTS : Computers : Programming : Languages : Python : Common Problems
> Can I run a script in an already running interpreter to hook a gui to a
> server process?
> http://www.faqts.com/knowledge-base/view.phtml/aid/4761/fid/245/lang/en
> 
> FAQTS : Computers : Programming : Languages : Python : Common Problems :
> Web Programming
> What advantages does PyApache give over simple Python scripting?
> http://www.faqts.com/knowledge-base/view.phtml/aid/1666/fid/246/lang/
> 
> FAQTS : Computers : Programming : Languages : Python : Installation and
> Configuration
> When I start Python 1.5.2, I get the error: Built-in exception class not
> found: EnvironmentError. Library mismatch?" Any ideas on solving this?
> http://www.faqts.com/knowledge-base/view.phtml/aid/5294/fid/238/lang/
> 
> FAQTS : Computers : Programming : Languages : Python : Language and
> Syntax
> How should a sortable sequence be implemented?
> http://www.faqts.com/knowledge-base/view.phtml/aid/5367/fid/241/lang/
> 
> FAQTS : Computers : Programming : Languages : Python : Modules
> Where can I find informations about the Gnuplot module?
> http://www.faqts.com/knowledge-base/view.phtml/aid/4025/fid/235/lang/
> 
> Is there an IPC-modul in Python ?
> http://www.faqts.com/knowledge-base/view.phtml/aid/4965/fid/235/lang/
> 
> FAQTS : Computers : Programming : Languages : Python : Modules : urllib
> How do I format my request to get an url/socket when there is a proxy in
> the middle and Proxy Authentication is required ?
> http://www.faqts.com/knowledge-base/view.phtml/aid/4182/fid/306/lang/
> 
> FAQTS : Computers : Programming : Languages : Python : Platforms :
> Windows
> Return parameters and win32com
> http://www.faqts.com/knowledge-base/view.phtml/aid/5291/fid/244/lang/
> 
> How do I perform an os.popen() on NT?
> http://www.faqts.com/knowledge-base/view.phtml/aid/5396/fid/244/lang/
> 
> FAQTS : Computers : Programming : Languages : Python : Tkinter
> Can I make something like jtable with tkinter?
> http://www.faqts.com/knowledge-base/view.phtml/aid/4019/fid/264/lang/
> 
> The Windows distribution is set up to work with Tcl/Tk version 8.0 dlls.
> How do I reconfigure it to work with a later version of Tcl/Tk?
> http://www.faqts.com/knowledge-base/view.phtml/aid/5149/fid/264/lang/
> 
> From within a function, is there a way to determine what the parent of a
> calling widget is?
> http://www.faqts.com/knowledge-base/view.phtml/aid/5320/fid/264/lang/
> 
> how to make a splash screen before app.mainloop()
> http://www.faqts.com/knowledge-base/view.phtml/aid/5432/fid/264/lang/



More information about the Python-list mailing list