Message330357
| Author |
liugang93 |
| Recipients |
liugang93 |
| Date |
2018年11月23日.19:35:08 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1543001708.41.0.788709270274.issue35304@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
-- run in Windows 10
1 -
f = open('test', "w+")
f.write('xxx\nyyy\nzzz')
f.seek(0)
f.readline()
print(f.tell()) # output 5 (xxx\r\n)
x = f.truncate()
print(x) # output 13 (xxx\r\nyyy\r\nzzz), why it is 13, not 5?
2 -
f = open('test', "w+")
f.write('xxx\nyyy\nzzz')
f.seek(0)
f.readline()
print(f.tell()) # output 5 (xxx\r\n)
f.seek(f.tell())
x = f.truncate()
print(x) # output 5 |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2018年11月23日 19:35:08 | liugang93 | set | recipients:
+ liugang93 |
| 2018年11月23日 19:35:08 | liugang93 | set | messageid: <1543001708.41.0.788709270274.issue35304@psf.upfronthosting.co.za> |
| 2018年11月23日 19:35:08 | liugang93 | link | issue35304 messages |
| 2018年11月23日 19:35:08 | liugang93 | create |
|