f.seek() unwanted output

thomasvangurp at gmail.com thomasvangurp at gmail.com
Mon Jan 5 08:52:56 EST 2009


I'm having trouble with a script that is printing the output of f.seek
() whereas in the documentation it is quoted not to have any output:

----
file.seek(offset[, whence])¶

    Set the file’s current position, like stdio‘s fseek. The whence
argument is optional and defaults to os.SEEK_SET or 0 (absolute file
positioning); other values are os.SEEK_CUR or 1 (seek relative to the
current position) and os.SEEK_END or 2 (seek relative to the file’s
end). There is no return value.
--------------

I have a file in memory.
when i try f.seek(0) #or any other value in f.tell()
it gives me 0 as output:

the following script illustrates my 'problem'
>>> for a in range(10):
	f.seek(a)


0
1
2
3
4
5
6
7
8
9
>>>

I don't want python to produce output when setting the file pointer.
Any help woul be appreciated.
Kind regards,
Thomas



More information about the Python-list mailing list