newbie form questions...
Sam Penrose
spenrose at well.com
Mon Oct 8 12:40:03 EDT 2001
More information about the Python-list mailing list
Mon Oct 8 12:40:03 EDT 2001
- Previous message (by thread): newbie form questions...
- Next message (by thread): Tkinter PhotoImage Class???
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
The data looks weird to you because you are pickling it. The pickle module
exists so that you can save Python objects to file and then read them back in
as Python objects. What you want to do is write to a regular file, something
like:
output = open('/home/nemir/output/form.txt', 'w')
separator = '=' # or a space, or whatever you want
allFields = ['field1', 'field2', 'field3'] # ...etc....
for field in allFields:
if form.has_key(field):
line = separator.join([field, form[field].value])
output.write(line)
output.write('\n') #newline character
output.close()
..there are slicker ways to do it, but that's the basic idea.
- Previous message (by thread): newbie form questions...
- Next message (by thread): Tkinter PhotoImage Class???
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list