Sorry for the lengthy description of the problem definition.
I'm new to python. Started learning about a month back. Today i was trying to write a list into a text file. Though i got the answer in this site and used the same method. And it worked great. But i encountered with another problem while writing the list into the text file.
The length of my list is '2372'. When I write the list into text file ,In a specific format required for me, I found only few list members were written. (Format is : First four list members in first row. Likewise, group of 4 list members in rest of the rows.) I found only 1938 list members are written into the text file. The size of the file found out to be 25KB.
I also tried to write each list member in new row, then also the size of text file found to be 25KB and this time even less list members were written compared to above case.
Is there a file size limitation to the text file in which list is written ? Kindly help me to solve this issue.
** The snippet of python code **
Lenlist = 2372
filptr = open(tempfile, 'w+')
count=0
for x in range(0,Lenlist):
filptr.write("%s\t" % line[x])
count+=1
if count>3:
if (count%4==0):
filptr.write("\n")
filptr.close()anywhere?close()a file to guarantee that it is flushed appropriately (or, better use a context manager (withstatement)).