[pygame] Very simple program fails. Why?

2005-04-26 Thread Brent W. Hughes
I'm just starting to learn pygame.  I write what I think is just about the 
simplest program that should display a window and then quit.
#---
import sys
import time
import pygame

pygame.init()
screen = pygame.display.set_mode((640,480))
pygame.display.set_caption(A Bug's Life)
time.sleep(4)
#---
When I run this program from within PythonWin, the Bug's Life window appears 
and everything looks okay, but after 4 seconds the window still persists. 
When I finally close it using the close box in the upper right of the 
window, a box pops up telling me an error occurred ant it wants to send a 
report to Microsoft.  I click Don't send and another box pops up telling 
me that the program was trying to access memory location 0x1c.

If I try to run the program stand-alone (outside of PythonWin), a DOS box 
pops up for a second or two, then the Bug's Life window flashes up for a 
fraction of a second, and then both windows disappear.

Am I doing something wrong?

Brent



-- 
http://mail.python.org/mailman/listinfo/python-list


[wxPython] How to allow events during long processing routine?

2005-03-09 Thread Brent W. Hughes
I'm running some code that takes a long time to finish.  I would like the 
user to be able to do other things while it is running.  It seems to me 
there is a function I can call to tell wxPython to process any pending 
messages or events.  I would call this perhaps every 1000 times through my 
loop.  Anybody remember the name of that function?

Brent


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to allow events during long processing routine?

2005-03-09 Thread Brent W. Hughes
Thanks, M.E.Farmer.

I continue to be impressed with how quickly and nicely one can get help 
here.

Brent


M.E.Farmer [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Survey says.
 ...wxYield()

 ;)
 M.E.Farmer
 


-- 
http://mail.python.org/mailman/listinfo/python-list


Pythonwin: Red squiggley underline and syntax error

2005-02-28 Thread Brent W. Hughes
I copied and pasted some text into my Python code and then Pythowin put a 
red squiggley underline under the two tabs at the beginning of the line. 
What does that mean?  I've tried various things including deleting the white 
space in front of the line and reinserting the tabs.  I've also tried 
retyping the entire line.  Sometimes, I can get the red line to go away but 
when I try to run the program, it gives me a syntax error on the line that 
had the red underline.  Help!

Brent


-- 
http://mail.python.org/mailman/listinfo/python-list


Newbie: SWIG or SIP?

2005-02-09 Thread Brent W. Hughes
I have a third-party DLL and it's associated .h file.  The DLL was written 
in C.  I have neither the associated .c files nor the .obj files for the 
DLL.  Can I use SWIG or SIP to build something that will allow me to use the 
DLL with Python?  And what is that something, an .obj file, another DLL or 
what?

Brent


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WYSIWYG wxPython IDE....?

2005-02-06 Thread Brent W. Hughes
I've also tried Boa Constructor a couple of times and keep having problems 
using it.  So I've got it stuck in the back of my mind for when it finally 
becomes ready for prime time.  (One of the problems was that the tutorial 
didn't quite match the program.)  I really like the concept.  It's a lot 
like Delphi, and I LOVE Delphi.  So one of these days I hope to love Boa 
Constructor for when I need to write GUI apps.

Brent


-- 
http://mail.python.org/mailman/listinfo/python-list


Possibly OT: Controlling winamp with Python

2005-02-04 Thread Brent W. Hughes
I'm running Windows XP and I'm using winamp to listen to internet radio 
stations.  Occasionally, an annoying commercial will come on.  I would like 
to write a Python program that, when run, will, in essence, push on winamp's 
mute button.  Then, after say 20 seconds, it will push the mute button again 
to restore the sound.  Is such a thing possible?

Brent


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Possibly OT: Controlling winamp with Python

2005-02-04 Thread Brent W. Hughes
The Python program won't decide whether a commercial is playing, I will.  At 
that point, I will run my program which will press mute, wait 20 seconds, 
and then press mute again.

Actually, I could leave the program running but minimized to the task bar. 
When I hear the advertisement, I just click on the program in the task bar. 
It knows what to do from there.

Brent


Kartic [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Brent,

 Question : how will your python script distinguish between a commercial
 and a song?

 I can understand if you are writing a streaming client in Python; in
 that case you can analyze the audio stream and decide if it is a
 commercial or a song/music.

 Did you check to see if there is already a Winamp plugin that would
 achieve this for you?

 Thanks,
 -Kartic
 


-- 
http://mail.python.org/mailman/listinfo/python-list


How to input one char at a time from stdin?

2005-01-25 Thread Brent W. Hughes
I'd like to get a character from stdin, perform some action, get another 
character, etc.  If I just use stdin.read(1), it waits until I finish typing 
a whole line before I can get the first character.  How do I deal with this?

Brent


-- 
http://mail.python.org/mailman/listinfo/python-list


Newbie: Pythonwin

2005-01-11 Thread Brent W. Hughes
1)  I'm running a program within Pythonwin.  It's taking too long and I want 
to stop/kill it.  What do I do (other than ctrl-alt-del)?

2)  I'm running a long program and I want to minimize it to let it continue 
to run in the background while I do something else in the foreground.  I try 
clicking on Pythonwin's minimize box but it doesn't respond until the Python 
program finally quits  Then it minimizes!  Any way I can do what I want 
here?

Brent


-- 
http://mail.python.org/mailman/listinfo/python-list