Re: Pygame, mouse events and threads

2006-08-24 Thread jedi200581
Ben Sizer wrote: > [EMAIL PROTECTED] wrote: > > > When I put the content of the run and input functions in the main > > thread, it's working, why not in the thread? > > Because event handling needs to be done in the main thread. So does > rendering. This is a limitation of the underlying system. >

Pygame, mouse events and threads

2006-08-24 Thread jedi200581
Hi, I'm trying to retreive mouse event in a python thread using pygame. It's not working and I don't know why! Here is the code: import pygame, sys, os, threading from pygame.locals import * from threading import * class Display(Thread) : """Class managing display""" def __init__(self, x

Re: Weird MemoryError issue

2006-07-19 Thread jedi200581
John Machin wrote: > On 20/07/2006 6:05 AM, John Machin wrote: > > On 20/07/2006 1:58 AM, [EMAIL PROTECTED] wrote: > >> def is_prime n: > > > > Syntax error. Should be: > >def is_prime n: > > Whoops! Take 2: > > Should be: > > def is_prime(n): Sorry for that, I was not able to cut-paste the c

Weird MemoryError issue

2006-07-19 Thread jedi200581
Hi, I'm new at python as I just started to learn it, but I found out something weird. I have wrote a little program to compute Mersenne number: # Snipet on def is_prime n: for i in range(2, n): if (n % i) == 0: return 0 else: return 1 for a in range(2, 1000): if (is_p