Writing Formatted txt to a file (xtreme newbie q)

Uri phrogeeb at hotmail.com
Mon May 10 19:03:42 EDT 2004


I am working on a program that reads (through Tkinter and a form of
text boxes, checkboxes, radio switches, sliders, etc) a set of values,
saves them to a file, and is also capable of loading from the file so
that the sliders switches checkboxes etc will have the paramaters
defined in the text file (that last part is peripheral, eventual, but
if there's something i have to do to set that up immediately I'd like
to do that.)

Right now, I'm basicly doing this in simple question-answer text
no-GUI format.

I've managed to set up the q&a scenario, and using a print statement
set it up like I'd like it to go into the file (space-dileneated)

However, I'm lost as far as writing it to the file in a formatted
form. I've looked around, and I'm pretty sure I can rule out pickle as
not what i want, but I'm having trouble figuring out what i do want.
The data is in the format of a list right now (maybe a dictionary at
some point) and there is one question and one answer per column. I
would like to set it up as "Question: Answer" in side-by-side
formatted columns, or perhaps "Question" over "Answer" in two rows,
answers on bottom.

Thanks in advance!

(Also, is there a pretty popular web-based forum for python or no?)



More information about the Python-list mailing list