[Tutor] creating files

Jim DeCaro jdecaro2 at comcast.net
Sun Nov 21 05:36:23 CET 2004


I am very new, and am writing a sketchy program to do a simple encryption
for a school project.  I have created a loop that iterates through letters
from a read file, and compares them to a list.  When it finds a match, it
converts the letter to a another letter from a corresponding list (hence the
encryption) and prints it to the screen.  The logic works fine, but I can't
save the output to a file.  I will not necessarily know what is in the file
when it is read, so I can't tell the program to write specific known data as
in the tutorials. The output comes from iterations.  How do I make a
variable that contains all of the letters combined in 1 string that can be
saved to a file? I can sometimes get it to write 1 of the letters to the
file.

I have not gotten to functions yet, so I was hoping there would be a method
to save each iterated letter to a variable. I have seen the append method,
but I'm not sure about it.

Thanks,

Jim




More information about the Tutor mailing list