Python sleep doesn't work right in a loop?

2005-04-06 Thread ritterhaus
Just a simple bit of code to toggle between two state at intervals... import time for i in range(4): print 'On' time.sleep(1) print 'Off' time.sleep(1) ... SHOULD toggle On and Off four times with one-second pauses. When I run this, the loop pauses the full eight seconds then prin

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread ritterhaus
This is running in the interactive 'PyShell', but in truth those print statements are part of a gui app that flashes a control in wx.widgets by toggling it's background color. The same behavior either way. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread ritterhaus
Nope. Does't work. Running Python 2.3.4 on Debian, Linux kernel 2.6. This is actually test code for a larger project... # flash the selected wx.TextControl for flasher in range(4): self.textField.SetBackgroundColour(255, 0, 0) time.sleep(0.8) self.textField.SetBackgroundColour(255, 25

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread ritterhaus
Actually, I've tried ALL of these things, and none of them work. I HAVE run the simple for-print-sleep test code to try to determine if this issue was specific to wx (that's good troubleshooting, folks - you narrow down the problem) and even that didn't work, so I thought I'd start with the simple

Re: Python sleep doesn't work right in a loop?

2005-04-07 Thread ritterhaus
I appreciate all the responses. It IS possible that wx and/or python is whacked on my machine. I've got python 2.2 and 2.3 installed, I have installed and uninstalled 2.4, I've had about three versions of wx installed along the way for different programs, so it is possible that it is just my machin