pyxpcomext
| resources: | Home Installation Downloads Samples Source Code Members Mailing List Bugs |
|---|
PyXPCOM Samples
Python Shell extension (download it)
The idea and parts of the pyshell code is based on the wonderful Javascript Shell.
Provides a shell like window that enables you to interact with the PyXPCOM Python interpreter and perform Python instructions. It provides tab completions through object inspection and has the ability to interact with the application through XPCOM. Check out the source.
PyShell in action, saying a hello from Python through the XPCOM nsIPromptService. The code for this:
promptSvc = components.classes["@mozilla.org/embedcomp/prompt-service;1"].\
getService(Components.interfaces.nsIPromptService)
promptSvc.alert(None, 'Greeting...', "Hello from Python")
PyXPCOM Examples extension (download it)
This is an extension that shows PyXPCOM working within Mozilla. It utilizes Python xpcom components, with XUL and JavaScript for the UI.
This shows off how you can use a Python UDP socket to communicate (send and receive) with a remote host. Check out the code.
PyDOM Example extension (download it)
This is an extension that shows PyDOM working within Mozilla. It utilizes Python working inside of XUL and the DOM (similar to JavaScript).
This shows off how you can use a Python UDP socket to communicate (send and receive) with a remote host. Check out the code.