Is There a CGI Expert In the House?? Good Grief!!

Ben Ocean zope at thewebsons.com
Wed May 2 12:48:11 EDT 2001


Hi;
Thanks for trying to help me with this CGI script! Here's what I'm running 
into right now. I'm still trying to capture the data that's being sent to 
the buffer (from a foreign URL as a result of visitors filling out a 
script). I appear to be successful in doing this, but for some reason can't 
extract the data. Here's my code:
 >>>
test = sys.stdin.readline()
if (test != None):
   print "test part 1 successful"
f = open("outfile.txt", "w")
sys.stdout = f
sys.stdout.writelines([test])
sys.stdout = sys.__stout__
sys.stdin = sys.__stdin__
f.close()
<<<
The test (part 1) is successful, but when I try to send it to outfile.txt 
nothing gets printed to the file. I can't cycle through the data in a for 
loop, either. I have no idea what's in *test*! I'd love to know. How do I 
extract this data?
TIA,
BenO





More information about the Python-list mailing list