using python in www site

Thomas A. Bryan tbryan at arlut.utexas.edu
Sun May 9 09:39:09 EDT 1999


Kaweh Kazemi wrote:
> 
> >To install the binary you only need FTP access and an cgi-bin
> >directory that executes .cgi as CGI programs. Here are the
> >steps needed:
> >
> > [steps]
> >
> >That's all -- you don't even need a TELNET access. 
>
> well, my ISP gave me access to a ftp directory which also has a
> cgi-bin directory, and on login the system says:
> 
>         "UNIX(r) System V Release 4.0"
> 
> there doesn't seem to be a compatible cgipython archive, am i right?
> 
> well, if someone has access to a machine using this type of unix and
> could create a compatible cgipython archive, this would help me very
> much. i even don't know, if this information is enough to create a
> cgipython-archive (same unix, different hardware-platforms?), but
> that's all i have at this time (if someone is willing to help and
> needs more information, i will check with my ISP, just tell me what
> you need to know).

Situation: 
Your ISP permits Perl cgi scripts.
You'd like to use Python, but they don't intend to install Python.
You decide to use mxCGIPython, but you don't know enough information 
 about the ISP's platform.  

Solution: 
Change the first line of the script at the bottom of the page
 to point to your ISP's Perl.
Upload the script to your cgi-bin directory.  
 (Make script executable if necessary)
Point your browser to the script.

I use uname -a to get all of the information the machine can provide.
You should be able to parse out the UNIX variant and version and 
the machine architecture.

Marc-Andre, maybe you could include this on the mxCGIPython page
for those in Kaweh's situation.

#!/usr/bin/perl
# uname -a should work on all UNIX machines
$info = `uname -a`;
# get rid of the newline and split the output on whitespace
chomp($info);
@info = split(/\s+/,$info);
# print the static part of the HTML page
print <<EOF;
content-type: text/html

<HTML>
<HEAD><TITLE>System Information</TITLE></HEAD>
<BODY>
<p>
Output of <TT>uname -a</TT>:
<p>
<UL>
EOF
# print the dynamic part of the page, 
# using a list for legibility
foreach $el (@info) {
  print "<LI>$el\n";
}
# finish up
print "<\UL></BODY>\n</HTML>\n";




More information about the Python-list mailing list