[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] pygame.mixer : playing the same file twice
On Wed, 2005-10-12 at 01:12 +0200, MickaÃl Leduque wrote:
> Oh, I thought the player would read from the begining of the file, and
> so do the seek(0) itself...
> Shouldn't that be in the docs?
When Pygame reads from the file-like objects it does no rewinding or
positioning. It just reads bytes from the stream. This means you can
load images from a lot more than files. You could read from an http
stream, or directly out of a zipped archive.
It could be better implied in the documentation how that works.
Generally in all of Python tools. When something wants to read from a
file-like object it usually only calls the read() method on it. (and
maybe sometimes close())