Re: wxPython fast and slow

2009-03-12 Thread David Bolen
iu2 writes: > A question about CallAfter: As I understand, this function is intended > to be used from within threads, where it queues the operation to be > performed in the GUI queue. I agree with the second half of the sentence but not the first. CallAfter is intended to queue up a delayed cal

Re: wxPython fast and slow

2009-03-09 Thread iu2
On Mar 9, 4:18 am, David Bolen wrote: > iu2 writes: > > Then even a time.sleep() or plain loop isn't sufficient since each may > have additional latencies depending on load.  You will probably need > to query a system clock of some type to verify when your interval has > passed. > > You might al

Re: wxPython fast and slow

2009-03-08 Thread Carl Banks
On Mar 8, 12:35 pm, iu2 wrote: > On Mar 8, 1:42 pm, Carl Banks wrote: > > > > > On Mar 8, 1:52 am, iu2 wrote: > > > > On Mar 6, 6:52 pm, Mike Driscoll wrote: > > > > > ... > > > > Can you post a sample application so we can try to figure out what's > > > > wrong? You might also cross-post this

Re: wxPython fast and slow

2009-03-08 Thread David Bolen
iu2 writes: > Indeed, but I don't think the CallAfter is necessary. I could just as > well remove the time.sleep in the original code. I could also make a > tight loop to replace time.sleep > for i in range(100): pass > and tune it to fit the speed I need. Except that CallAfter passed contro

Re: wxPython fast and slow

2009-03-08 Thread iu2
On Mar 9, 12:44 am, Scott David Daniels wrote: > iu2 wrote: > > Here is the timer version. It works even more slowly, even with > > PyScripter active: ... > > > I actually tried this one first. Due to the slow speed I changed to > > looping inside the event. > > I don't understand why it takes so

Re: wxPython fast and slow

2009-03-08 Thread Scott David Daniels
iu2 wrote: Here is the timer version. It works even more slowly, even with PyScripter active: ... I actually tried this one first. Due to the slow speed I changed to looping inside the event. I don't understand why it takes so long to move that square with wx.Timer set to 1 ms interval. Perhaps

Re: wxPython fast and slow

2009-03-08 Thread iu2
On Mar 8, 1:42 pm, Carl Banks wrote: > On Mar 8, 1:52 am, iu2 wrote: > > > > > On Mar 6, 6:52 pm, Mike Driscoll wrote: > > > > ... > > > Can you post a sample application so we can try to figure out what's > > > wrong? You might also cross-post this to thewxPythonmailing list. > > > They might k

Re: wxPython fast and slow

2009-03-08 Thread Mike Driscoll
On Mar 8, 3:52 am, iu2 wrote: > On Mar 6, 6:52 pm, Mike Driscoll wrote: > > > ... > > Can you post a sample application so we can try to figure out what's > > wrong? You might also cross-post this to thewxPythonmailing list. > > They might know. > > > Mike- Hide quoted text - > > > - Show quoted

Re: wxPython fast and slow

2009-03-08 Thread John Posner
> def move_panel(self, evt): > def gen(): > for x in range(200): > yield x > for x in range(200, 0, -1): > yield x > for x in gen(): > self.square.SetPosition((x, 30)) > time.sleep(0.005) > I can'

Re: wxPython fast and slow

2009-03-08 Thread Carl Banks
On Mar 8, 1:52 am, iu2 wrote: > On Mar 6, 6:52 pm, Mike Driscoll wrote: > > > ... > > Can you post a sample application so we can try to figure out what's > > wrong? You might also cross-post this to thewxPythonmailing list. > > They might know. > > > Mike- Hide quoted text - > > > - Show quoted

Re: wxPython fast and slow

2009-03-08 Thread iu2
On Mar 6, 6:52 pm, Mike Driscoll wrote: > ... > Can you post a sample application so we can try to figure out what's > wrong? You might also cross-post this to thewxPythonmailing list. > They might know. > > Mike- Hide quoted text - > > - Show quoted text - Hi, thanks for your reply Here is a s

Re: wxPython fast and slow

2009-03-06 Thread Lie Ryan
iu2 wrote: Do you have any idea of what is going wrong? I think this might be related to the OS's process prioritization, focused Windows would get more priority than background window. -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython fast and slow

2009-03-06 Thread Mike Driscoll
On Mar 6, 8:41 am, iu2 wrote: > Hi guys, > > Can you please help me with this: > I wrote a little game in wxPython where I move small panels (showing > bitmaps (100 x 100)) on the screen. > > This is similar to the code I wrote: > > for i in xrange(1, steps + 1): >     my_panel.SetPosition(...) >

Re: wxPython fast and slow

2009-03-06 Thread Almar Klein
That's weird. It might have to do with the main loop. I am not familiar with pyscripter, but it might supply a wx mainloop. However, if that is the case, I would expect the app to run slower in pyscripter, not when run without it... So can you use wx interactively from pyscripter? In other words,

wxPython fast and slow

2009-03-06 Thread iu2
Hi guys, Can you please help me with this: I wrote a little game in wxPython where I move small panels (showing bitmaps (100 x 100)) on the screen. This is similar to the code I wrote: for i in xrange(1, steps + 1): my_panel.SetPosition(...) time.sleep(0.1 / steps) I use PyScripter (Win