Where O Where Did My Data Buffer Go?
Sheila King
sheila at spamcop.net
Thu May 3 02:17:16 EDT 2001
On Thu, 3 May 2001 00:50:27 -0500, "Chris Gonnerman"
<chris.gonnerman at newcenturycomputers.net> wrote in comp.lang.python in article
<mailman.988868705.15019.python-list at python.org>:
:The problem here is, since the KBB server is using HTTP POST to send the
:data, your sys.stdout stream is connected back to KBB. THEY don't need
:the data echoed back.
:
:The data needs to be collected and sent via SMTP or saved to disk.
OK, then how about this?
import cgi
# instantiate form
form = cgi.FieldStorage()
f = open('tempfile.txt', 'w')
# print form contents to a file
for field in form.keys():
f.write(field + " = " + form[field].value + '\n')
f.close()
This should at least save all the data sent back to Ben's script from KBB into
a file called tempfile.txt, right?
--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/
More information about the Python-list
mailing list