Re: Diff between opening files in 'r' and 'r+' mode

2007-01-30 Thread Sick Monkey
It was a little hard to follow your logic of your sample code (writing, reading and writing again), but (1)The difference between r and r+. - 'r+' opens the file for both reading and writing. - 'r' should be used when the file will only be read. I am not sure on how you want to store the co

Re: Diff between opening files in 'r' and 'r+' mode

2007-01-30 Thread Ben Finney
"raghu" <[EMAIL PROTECTED]> writes: > i want to know the difference between 'r' mode and 'r+' mode > 1.i = open('c:\python25\integer.txt','w')>for writiing > i.write('hai')->written some content in text file > i = open('c:\python25\integer.txt','r')>for reading > print i.

Diff between opening files in 'r' and 'r+' mode

2007-01-30 Thread raghu
i want to know the difference between 'r' mode and 'r+' mode 1.i = open('c:\python25\integer.txt','w')>for writiing i.write('hai')->written some content in text file i = open('c:\python25\integer.txt','r')>for reading print i.read()>for printing the contents in that te