On Jan 5, 8:52 am, "thomasvang...@gmail.com" <thomasvang...@gmail.com> wrote: > 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
You can also avoid the output by assigning the output to something: >>> for a in range(10): dummy=f.seek(a) -- http://mail.python.org/mailman/listinfo/python-list