On 01/30/2013 01:51 AM, Gayathri S wrote:
Hi All....! I don't know how to read text file in python. If the data values are stored in a text file format, for example(1,30,60,90,120...200) means what i would do for reading it in python. could you just explain it.
infile = open("filename", "rt") will open a text file line = infile.readline() will read one line from it, as a str After that, you can parse it anyway you like. -- DaveA _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor