Message101892
This is an example, last assert return an error :
f = open('data.txt', 'w')
f.write("""line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
line 11
""")
f.close()
f = open('data.txt', 'r')
assert f.readline() == 'line 1\n'
assert f.read() == """line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
line 11
"""
f.close()
import codecs
f = codecs.open('data.txt', 'r', 'utf8')
assert f.read() == """line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
line 11
"""
f.close()
f = codecs.open('data.txt', 'r', 'utf8')
assert f.readline() == 'line 1\n'
# this assert return a ERROR
assert f.read() == """line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
line 11
"""
f.close()
Regards,
Stephane |
|
Date |
User |
Action |
Args |
2010-03-29 15:09:56 | harobed | set | recipients:
+ harobed |
2010-03-29 15:09:55 | harobed | set | messageid: <1269875395.81.0.132261115225.issue8260@psf.upfronthosting.co.za> |
2010-03-29 15:09:53 | harobed | link | issue8260 messages |
2010-03-29 15:09:53 | harobed | create | |
|