From: tbryan at arlut.utexas.edu (Thomas A. Bryan)
Date: Sun, 09 May 1999 09:39:09 -0400
Subject: using python in www site
References: <3732fd89.446889923@news.vbs.at> <373316D9.AB851DC5@zarlut.utexas.edu> <373317F6.737B4D40@zarlut.utexas.edu> <7h2v9m$ls1$1@agate.berkeley.edu> <37355EEC.2E537D9C@lemburg.com> <37357519.608573842@news.vbs.at>
Message-ID: <37358FFD.9AAB4C6A@arlut.utexas.edu>
Content-Length: 2150
X-UID: 1732                                                

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";




