We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.


seek( offset[, whence])

Set the file’s current position, like stdio‘s fseek(). The whence argument is optional and defaults to 0 (absolute file positioning); other values are 1 (seek relative to the current position) and 2 (seek relative to the file’s end). There is no return value. Note that if the file is opened for appending (mode 'a' or 'a+'), any file.seek operations will be undone at the next write. If the file is only opened for writing in append mode (mode 'a'), this method is essentially a no-op, but it remains useful for files opened in append mode with reading enabled (mode 'a+'). If the file is opened in text mode (without 'b'), only offsets returned by file.tell are legal. Use of other offsets causes undefined behavior.

Note that not all file objects are seekable.