Debugging and Testing Your Script

Before putting your CGI scripts online, you need to be sure that they are working fine. You have to test them carefully, especially in near bounds and out of bounds conditions. A script that crashes in the middle of its job can cause large problems, such as data inconsistency in a database application. This is why you would use a transaction when updating a database from a cgi script (if it was deemed important enough). You should eliminate most of the problems by running your script from the...

MailmanGNU Mailing List Manager

Mailman is a Web integrated mailing list manager that helps manage email discussion lists, much like Majordomo and Smartmail. Unlike most similar products, Mailman gives each mailing list a Web page, and allows users to subscribe, unsubscribe, and so on, over the Web. Even the list manager can administer his list entirely from the Web. Both users and system administrator can do almost everything through an Internet connection. Mailman also integrates most things people want to do with mailing...

Python XML Package

For those who want to play around with XML in Python, there will be a Python XML package to serve several purposes at once. This package will contain everything required for basic XML applications, along with documentation and sample code basically, something easy to compile and install. A release candidate of the latest release of this package is now available as PyXML-0.5.5.tar.gz (GPG signature), dated June 5, 2000. This version contains SAX, the Pyexpat module, sgmlop, the prototype DOM...

Index terms contained in this section

Public attrs() attribute public methodsQ attribute readonly attrs() attribute applications Excel opening and manipulating from Python 2nd 3rd 4th 5th 6th transferring data between win32all opening and manipulating from Python 2nd 3rd 4th 5th 6th attributes public attrs() public methodsQ readonly attrs() AutoFitQ function calculator object source code 2nd 3rd 4th 5th 6th Cells() function changing Common Object Model (COM) creating clients, Excel 2nd 3rd importing calculator object 2nd 3rd 4th...

Summary

This chapter explains how to use Python to interface objects from different applications on a single machine, and across networks through distributed systems. Python has very comprehensive support for object interfacing and distributing technologies. COM is the most widely used component software model in the world when it comes to object interfacing. COM provides a rich set of integrated services, a wide choice of easy-to-use tools, and a large set of available applications. The COM genealogy...

Environment Variables

Environment variables are one of the methods that Web servers use to pass information to a CGI script. They are created and assigned appropriate values within the environment that the server produces for the CGI script. The next code generates a list of all environment variables that you have available at the moment, in your browser. import os print Content-type text html n print of Environment print lt BODY gt print s gt s lt BR gt k,v print The following list is the output collected from my...

Addmember Python Class

Next, I list the attributes that classes expose to programmers. classname.__dict_ This attribute contains the class namespace dictionary. gt gt gt studentfile.newstudent._dict_ '_init_' lt function _init_ at 799e90 gt , '_doc_' 'New student classname.__doc__ This one returns the documentation string of the class. gt gt gt studentfile.newstudent._doc_ classname.__name_ This attribute returns the class name. gt gt gt studentfile.newstudent._name_ classname.__module__ This one provides the module...

Code Examples

This example generates a Python COM server that exposes a parking lot object. The example uses a Visual Basic graphical interface to manipulate the vehicles of this parking lot. Each vehicle is a Python Object that is also defined as a Python COM Server object. The first thing to do is to generate two clsids one for each object. gt gt gt import pythoncom gt gt gt print pythoncom.CreateGuid BD2CB7C0-3BB9-11D4-804E-00 50 041A5111 gt gt gt print pythoncom.CreateGuid BD2CB7C1-3BB9-11D4-804E-00 50...

ActiveX

An ActiveX control is an OLE control that can live inside an HTML page it can be simple Window objects, such as buttons, text boxes, or scrollbars. It also can be quite complicated, for example, a bar chart graph display can be an ActiveX control. An entire spreadsheet can also be a single control. Each ActiveX control has properties and reacts to external events. Its properties can be modified to change its appearance. For example, its containing program can set color and fonts. External...

Implementing COM Objects in Python

Script Form Edit Delphi

In order to implement COM objects in the Python version of Windows, you need a set of extensions developed by Mark Hammond and Greg Stein. Part of the win32com package, these extensions enable you to do everything that is COM-related, including writing COM clients and COM servers. The following link takes you to the download page of these extensions All the Win32 extensions including the COM extensions are part of the win32all installation package. This package also installs the PythonWin IDE...