Ok, so i am creating a program for my school's football team and in one part i
need to store a list of variables (their name, height, weight, and grade) in a
txt file to bring up later. i know how to create and read from files ( file =
open("file_name", ''w/r/a") ). But what i need to do is create a individual
file for each member on the roster as they add them in. here is my code:
name = self.name.GetValue() < gets their name from the text box
stats = str(self.name.GetValue()) + "\n" < gets their name to put
into the file
stats += str(self.height.GetValue()) + "\n" < gets their height
stats += str(self.weight.GetValue()) + "\n" < gets their weight
stats += str(self.grade.GetValue()) + "\n" < gets their grade
info = open(name + ".txt", "r") < this creates the file for it to all
go into using the name we get from above to name it.
But when a try and write into the file wright after that last line it wont let
me so is there anything i'am missing or should change?
_________________________________________________________________
Windows Liveā¢: Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor