An Introduction to CGI

CGI (Common Gateway Interface) is a standardized way for the Web Server to invoke an external program to handle the client request. It is possible for the external program to access databases, documents, and other programs as part of the request, as well, and present customized data to viewers via the Web. A CGI script can be written in any language, but here, of course, we are using only Python. CGI enables you to handle from the low end of mail-forms and counter programs to the most complex...

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...

MIME Parsing and Manipulation

MIME (Multipurpose Internet Mail Extensions) is a standard for sending multipart multimedia data through Internet mail. This standard exposes mechanisms for specifying and describing the format of Internet message bodies. A MIME-encoded message looks similar to the following Content-Type multipart mixed Date Mon, 03 Apr 2000 18 30 23 -0400 From Andre Lessa < alessa lessaworld.com> To Renata Lessa < rlessa lessaworld.com> Content-Type text plain charset us-ascii Sorry Honey, I am late...

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

Protection environments Bastion module 2nd 3rd environments applications protecting functions Restricted Execution 2nd 3rd modules Bastion 2nd 3rd rexec 2nd 3rd 4th programs protection environments protection application environments Restricted Execution mode 2nd 3rd rexec module 2nd 3rd 4th rexec.RExec() function software 2002, O'Reilly & Associates, Inc. jment > Python Developer's Handbook > 9. Other Advanced Topics > Scientific Computing Python is extensively used for scientific...

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...

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...

PyFLTK

FLTK Fast Light Tool Kit, pronounced fulltick is a C graphical user interface toolkit for X UNIX , OpenGL, and WIN32 Microsoft Windows NT 4.0, 95, or 98 . It is also largely compatible with the XForms library. FLTK is currently maintained by a small group of developers across the world with a central repository in the United States, and it is distributed under the GNU Library GPL LGPL . FLTK was originally created to build in-house applications at Digital Domain for image processing and 3D...