A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2003-September/223200.html below:

file object, details of modes and some issues.

file object, details of modes and some issues. file object, details of modes and some issues.simon place simon_place at whsmithnet.co.uk
Thu Sep 4 18:35:11 EDT 2003
could someone confirm ( or otherwise ) this  bug.

manual says file.truncate leave the pointer unmoved, well it doesn't, and left 
me with a bug in a program that took a bit of finding.


 >>> f=file('test.dat','rb+')
 >>> f.write('1234567890')
 >>> f.close()
 >>> f=file('test.dat','rb+')
 >>> f.read(5)
'12345'
 >>> f.tell()
5L
 >>> f.truncate()
 >>> f.tell()
10L
 >>>

( PythonWin 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on
win32. )



More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4