[FAQTS] Python Knowledge Base Update -- June 1st, 2000
Fiona Czuczman
fiona at sitegnome.com
Thu Jun 1 11:03:43 EDT 2000
Greetings,
Only a couple of entries into http://python.faqts.com tonight.
Fiona Czuczman
## New Entries #################################################
-------------------------------------------------------------
I'd like to create a subclass of list that loads its contents from a file when you instantiate it. What do I subclass to do this?
http://www.faqts.com/knowledge-base/view.phtml/aid/3424
-------------------------------------------------------------
Fiona Czuczman
Remco Gerlich
You can't directly subclass types, like lists and integers. This is
commonly viewed as a flaw in Python, maybe this will be changed once.
However, you can subclass UserList.UserList, a Python wrapper around a
list (see Lib/UserList.py for its source).
-------------------------------------------------------------
(win32api) how to enumerate processes?
http://www.faqts.com/knowledge-base/view.phtml/aid/3428
-------------------------------------------------------------
Fiona Czuczman
Mark Hammond
You need to use the performance monitor functions - check out
win32pdhutil.py for a demo.
-------------------------------------------------------------
What's the event name for catching mouse movement without a button pressed?
http://www.faqts.com/knowledge-base/view.phtml/aid/3427
-------------------------------------------------------------
Fiona Czuczman
John Grayson
>From John Grayson's book "Python and Tkinter Programming"
I think Example_6_2.py demostrates this, and the event is also noted on
page 618.
However, this snippet tracks the motion of the mouse without a button
down...
from Tkinter import *
root = Tk()
def motion(event):
print 'Mouse: x=%d, y=%d' % (event.x, event.y)
frame = Frame(root, width=250, height=250)
frame.bind('<Motion>', motion)
frame.pack()
root.mainloop()
More information about the Python-list
mailing list