| ★ wanayoo — archive 1999 http://www.python.org/ftp/python/pythonwin/html/pwmodules.html | Nouvelle recherche | Portail wanayoo |
Additional
Modules This section lists some of the modules supplied with and available for Pythonwin.
If any of these modules have documentation (beyond what is listed here), you should find it in the documentation index.
This list is in 2 sections. The first section lists modules supplied with the Pythonwin distribution. The second lists modules available elsewhere.
If you have an extension module you would like listed, please mail Mark Hammond
bsddb
mmapfile
win32com (COM/OLE/ActiveX Extensions)
timer
win32api
win32ras
win32ui
win32pdh
win32pipe
win32trace
nspi
ODBC
calldll
Opengl, glut and glu
DOS Interrupts and Global Memory
It should be noted that in almost all cases, these modules do
not require Pythonwin - they will work with a vanilla Python
1.4 build and from standard Python.exe.
bsddb is a port of the Berkely DB code for Windows NT. This is a full port of the Unix bsddb package, and you should find documentation in the normal Python documentation.
Access to Win32 Memory Mapped files. Memory mapped files allow efficient sharing of data between separate processes. It allows a block of (possibly shared) memory to behave like a file. No documentation.
This is a package that allows full COM (previously known as OLE) integration. These modules allow you to be an automation client (ie, control other applications) or an automation server (ie, be controlled by other apps). Please see the COM documentation for more details.
The win32 Performance Data Helper module and utility. These are interfaces to the pdh dll from Microsoft. MSDN has documentation on the interface.
A module that provides popen() functionality (and more!) to work from a win32 GUI process (which os.popen doesnt!). This is documented in the Pythonwin help file.
These modules allow one Python process to generate output via a "print" statement, and another unrelated Python process to display the data. This works even if the Python process generating the output is running under the context of a service, where more traditional means are not available. The module works on Windows 95 and Windows NT.
To enable this debugging, simply "import win32traceutil" somewhere in your program - thats it! This automatically re-directs the standard Python output streams to the remote collector (If that behaviour is undesirable, you will need to use win32trace directly.) To actually see the output as it is produced, start a DOS prompt, and run the file "win32traceutil.py" (eg, double-click on it from Explorer, or "python.exe win32traceutil.py") This will print all output from all other Python processes (that have imported win32traceutil) until you kill it with Ctrl+Break!)
You should ensure that only one "collector" process is running at a time. If not, only one of the collector processes will see the output - although which process gets which bit of output is indeterminate!
Also, there is a limitation of 64k of buffered data. If 64k of data is stored before any collector has read it, the buffer will be emptied, and filled from the start. This means previous output is lost. This should only ever happen if an output process has been running for a while with no collector running.
Access to the Win32 timers. Timers are only available in Pythonwin. No documentation, except what follows:
The following code demos how to make a timer.
import timer
# glork holds a simple counter for us.
class glork:
def __init__ (self, delay=1000, max=10):
self.x = 0
self.max = max
self.id = timer.set_timer (delay, self.increment)
def increment (self, id, time):
print 'x = %d' % self.x
self.x = self.x + 1
# if we've reached the max count,
# kill off the timer.
if self.x > self.max:
# we could have used 'self.id' here, too
timer.kill_timer (id)
# create a counter that will count from '1' thru '10', incrementing
# once a second, and then stop.
def demo (delay=1000, stop=10):
g = glork(delay, stop)
Access to the Win32 API. Documented in Pythonwin.hlp
Access to the Win32 Remote Access API. This allows you to make and break RAS connections, query the status of connections, etc. Some of the methods may only work on certain platforms (eg, "AddPhoneBook" does not work on Windows NT 3.51 - presumably it will in later versions of NT. Documented in Pythonwin.hlp
Access to the MFC GUI API. Documented in Pythonwin.hlp Exposes a large amount of MFC - most objects are supported, and a very tight integration with MFC is achieved. Almost all methods and objects are documented in the Pythonwin.hlp file. Also see the Pythonwin documentation index.
Note - not tested or supported any more. No one seems to want or use this - mainly because the plug-in created is still win32 specific. Get MSIE, and play with the ActiveX stuff instead.
The Netscape plug in module. In the "misc" directory, there is a sample plug-in DLL "npipw.dll". This npipw.dll must be renamed, have its "version" resource edited (supplying different file extensions, mime type, startup command new-instance command, etc.) and copied to the Netscape plugins directory. When initialised, this DLL will attach to the nspi module. This module can then be used by the Python plug-in code to call back into the browser.
This is a module which exposes the ODBC database API to Python. For more details, please see the ODBC documentation
A module which allows the person who knows what they are doing to call arbitary Windows DLLs. This can be used for all sorts of amazing things, but be prepared to crash your program during debugging of your own code! Sam Rushing is the author, and keeps the latest at ftp://squirl.nightmare.com/pub/python/python-ext
David Ascher (da@maigret.cog.brown.edu told me on 12-Mar-96 that "I have also gotten the opengl, glut and glu modules [to work]. Contact me for information, as nothing in that domain is finalized.".
Sheesh - I dont even know what half of these do, so I suggest you contact David for details!
Oren Goldschmidt og200@cam.ac.uk tells the Pythonwin SIG "I have a pythonwin module to access arbitrary DOS software interrupts and allocate/access global DOS memory. (To communicate with primitive DOS driver software etc.) In case anyone is interested!"