In article 4b617f4...@dnews.tpgi.com.au,
Lie Ryan lie.1...@gmail.com wrote:
f = open('input.txt', 'r+')
for line in f:
s = line.replace('python', 'PYTHON')
# f.tell()
f.write(s)
When f.tell() is commented, 'input.txt' does not change; but when
uncommented, the f.write() succeeded
In the code:
f = open('input.txt', 'r+')
for line in f:
s = line.replace('python', 'PYTHON')
# f.tell()
f.write(s)
When f.tell() is commented, 'input.txt' does not change; but when
uncommented, the f.write() succeeded writing into the 'input.txt'
(surprisingly, but not entirely
On Jan 28, 7:12 am, Lie Ryan lie.1...@gmail.com wrote:
In the code:
f = open('input.txt', 'r+')
for line in f:
s = line.replace('python', 'PYTHON')
# f.tell()
f.write(s)
[snip]
My guess is that there are a few possible problems:
1) In this case, writing to file opened
* Anthony Tolle:
On Jan 28, 7:12 am, Lie Ryan lie.1...@gmail.com wrote:
In the code:
f = open('input.txt', 'r+')
for line in f:
s = line.replace('python', 'PYTHON')
# f.tell()
f.write(s)
[snip]
My guess is that there are a few possible problems:
1) In this case, writing to