[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pygame] diff betn interactive and non-interactive scripts
- To: pygame-users <pygame-users@seul.org>
- Subject: [pygame] diff betn interactive and non-interactive scripts
- From: Prahlad Vaidyanathan <slime@vsnl.net>
- Date: Tue, 9 Apr 2002 12:29:37 -0400 (EDT)
- Delivered-To: archiver@seul.org
- Delivered-To: pygame-users-outgoing@seul.org
- Delivered-To: pygame-users@seul.org
- Delivery-Date: Tue, 09 Apr 2002 12:29:38 -0400
- Reply-To: pygame-users@seul.org
- Sender: owner-pygame-users@seul.org
Hi,
I just started playing around with the pygame.mixer module, and found
this quirk. In the interactive session, the following works (ie. it
playes the wav file) :
"""
$ python
Python 2.2 (#2, Feb 25 2002, 20:10:48)
[GCC 2.95.2 20000220 (Debian GNU/Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import pygame.mixer
>>> pygame.mixer.init()
>>> sf = pygame.mixer.Sound('test/test.wav')
>>> sf.play()
<Channel object at 0x814f798>
>>>
"""
But, if I put these exact same lines into a script and run it from the
same python interpreter (2.2), it does not play it.
"""
$ python test.py
$ cat test.py
import pygame.mixer
pygame.mixer.init()
sf = pygame.mixer.Sound('test/test.wav')
sf.play()
"""
Why is this ? The only thing I noticed was that in the first
(interactive) case, it would print <Channel object ...>, and only after
a small amount of time, start playing the file.
Is that delay of any consequence ?
I hope my question has been clear enough. I hope to use pygame to build
a music player (I couldn't find any on the pygame.org site), but so far
my efforts haven't been too successful :-(
Thanks !
pv.
--
Prahlad Vaidyanathan <http://www.symonds.net/~prahladv/>
The next person to mention spaghetti stacks to me is going to have
his head knocked off.
-- Bill Conrad
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org