using python in www site

Tom Bryan tbryan at zarlut.utexas.edu
Fri May 7 12:37:45 EDT 1999


Kaweh Kazemi wrote:
> 

Hi, Kaweh.  

> i am working on a www site were our costumer wants to create a
> (printable) document for his customer. some data for the document
> (name, address, etc.) will be given using input fields.

Clarification:  you want to produce some HTML that looks nice enough
to print from a browser, and that HTML will depend on a form that 
the user fills in.   Is that correct?
 
> the whole damn thing should be printable, preferable on Windows
> Systems.

Um...which whole damn thing?  Every page on the website?  
 
> i know python, i know html and a little bit of javascript, but have no
> idea about CGI and about perl (and i am not interesting in learning it
> over the weekend).

If you need to do CGI, you'll have to write a program in whatever 
language is on the machine.  Do they have Python?  CGI is simple.
The web server starts your program.  The environment includes 
some parameters sent by the user's browser and by the web server 
itself.  Input from forms is passed to the program to STDIN.  
(I think ISINDEX queries actually use command line args for input.)
Of course, the input passed to you in a munged format.  People 
have written CGI libraries in multiple languages (including Python).  
These always include facilities for decoding the form input and 
stuffing it into a data structure.
 
> is there a way to achieve this? any hints or pointers would help from
> experienced users. i know this is much to ask for, but i need help
> where i can get it from.

If you can use Python
http://www.python.org/doc/current/lib/module-cgi.html
For general CGI info 
http://hoohoo.ncsa.uiuc.edu/cgi/interface.html
http://www.webthing.com/tutorials/cgifaq.html

 
> the customers ISP is a "UNIX(r) System V Release 4.0" system (surely
> running perl, cause they allow cgi-scripts), clients will be mostly
> Windows (i don't need to care about others in this  situation).

Client doesn't matter for the CGI.  IE and Netscape allow users to 
print a webpage.  Just make sure the output fits on a single or 
multiple printed pages well.  You could create output formatted 
with <table> tags, <pre> tags, or no tags (no HTML, just plain text!).  
There's probably a nifty Javascript way to put a button on a page 
to invoke the print command.  Or you could just tell users to use
File-->Print.

(To make this post not too off-topic...)
You might want to convince the ISP to install M.A. Lemburg's 
recently-released mxCGI distribution: a compact, easy-to-install
Python.  

http://starship.skyport.net/~lemburg/mxCGIPython.html


-- 
tbryan at zarlut.utexas.edu
Remove the z from this address to reply.
Stop spam!  http://spam.abuse.net/spam/




More information about the Python-list mailing list