Re: [Tutor] moving widgets around

2004-12-30 Thread John Miller
I recently had occasion for drag 'n drop functionality in Tkinter, and 
after much searching around decided that tkdnd.py was the only viable 
solution (at least, that I could find). The code is actually quite 
understandable (well, at the 'large chunks' level). In the directory 
where tkdnd.py is located simply type:

pythonw tkdnd.py
and it will work. If you find anything simpler or more bare bones, 
please let us know.

John Miller
On Dec 29, 2004, at 4:25 PM, Sean McIlroy <[EMAIL PROTECTED]> 
wrote:

I'd like to get some example code showing how to move
widgets around in drag-and-drop fashion. I've tried
looking at tkDND.py (I think that's what it's called)
but that was a little involved - what I want to know
is the barest of bare bones. Any help would be majorly
fabulous. Merci beaucoup.
STM
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] primes - sieve of odds

2005-03-26 Thread John Miller
On Mar 24, 2005, at 6:01 AM, C Smith <[EMAIL PROTECTED]> wrote:
What follows is an attempt based on the previous tutor-evolved sieve
that extends the range in which to find the next prime by a factor of
2 over the last known prime. A similar algorithm is on ASPN (I
bellieve), under
Space-efficient version of sieve of Eratosthenes.
D. Eppstein, May 2004
Oh, please...ignore what I suggested and look at Eppstein's code. It's
a thing of beauty and just keeps chugging out primes well past what the
inefficient version that I suggested could do with the same memory.
It's a "tortoise and hare" race as the memory gets chewed up by the
esieve approach.
The ASPN version of Eppstein's program is an older one than the one at
the following site:
http://www.ics.uci.edu/~eppstein/PADS/Eratosthenes.py
How does one actually use this module? For example:
>>> import eratosthenes
>>> eratosthenes.primes()

>>> eratosthenes.primes().next()
2
>>> eratosthenes.primes().next()
2
>>> eratosthenes.primes().next()
2
How does one get beyond the first prime?
Thanks,
John
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor