capture output from a java class in a cgi

marc_risney at my-deja.com marc_risney at my-deja.com
Tue Dec 14 23:13:40 EST 1999


I do not know how to capture output from a java class within a CGI, and
redirect the ouput to either a shelve, text file or sendmail( I may need
to do all 3).  in essence I am using a java class to encrypt data for a
loadkey, I pass the java class a datestring, a product type and other
info, and I am supposed to get a output

if I pass the class 1-1-1-0--1234-01012000
then the output from the Checksum class would have the following format:
1-1-1-0-ABCDEFGHIHKLM-1234-01012000.

I can create a simple script and invoke it from a console, yet when I
try to invoke the java interpreter from a CGI or a non console
windows .pyw script, I do not get the output, and help would be mucg
appreciated, here is my script:

def GenerateLicenceKey(prod,exprdate):
    key = "java Keygen" + str(prod) + "-1-1-0--1234-" + exprdate
    keyfile = open('keys.txt','a')
    rslts = os.popen(key)
    for line in rslts.readlines():
                keyfile.write(line)
    keyfile.close()




thanks


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list