Re: Checking a Number for Palindromic Behavior

2009-10-19 Thread Guyon Morée
> >def is_palidrome (n): > >    return str(n) == ''.join (reversed (str(n))) > > >which will return True if integer n is a palidromic or False > >otherwise. > > I wouldn't normally provide a direct solution to this type of request; but > since you have, may I suggest: > > def is_palindrome (n): >  

smtplib upload progress

2009-10-19 Thread Guyon Morée
Hi, I wanted to use smtplib to send a bunch of files. All good, except I cant monitor the upload progress as far as I can see. So I monkey patched the SMTP.sendall method, which chops up the data and keeps calling a provided callback for every chunk of data sent. This feels kind of dirty and I w

Re: Executing other python code

2008-01-31 Thread Guyon Morée
> One simple solution would be to forbid import statements in the > scripts, to import the scripts as modules and inject whatever > functions you want them to be able to use in the module's namespace. how do you 'forbid' imports? Guyon http://gumuz.nl -- http://mail.python.org/mailman/listinf

How does one get onto planet.python.org?

2008-01-31 Thread Guyon Morée
Hi, I'm looking for a signup link to get my blog included in http://planet.python.org/, but I couldn't find one. I emailed [EMAIL PROTECTED] to no avail. any ideas? thanks, Guyon http://www.gumuz.nl/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: fast pythonic algorithm question

2006-08-01 Thread Guyon Morée
Brian you are right, but in my case (host, port, protocol) is unique. [EMAIL PROTECTED] schreef: > Guyon Morée wrote: > > i have a big list of tuples like this: > > > > [ (host, port, protocol, startime, endtime), .. ] etc > > > > now i have another

Re: fast pythonic algorithm question

2006-08-01 Thread Guyon Morée
Memory is no problem. It just needs to be as fast as possible, if that's what this is, fine. If not, I'd like to find out what is :) thanx, Guyon Moree http://gumuz.looze.net Paul Rubin schreef: > "Guyon Morée" <[EMAIL PROTECTED]> writes: > > if (((src_

fast pythonic algorithm question

2006-08-01 Thread Guyon Morée
hi all, i have a big list of tuples like this: [ (host, port, protocol, startime, endtime), .. ] etc now i have another big(ger) list of tuples like this: [(src_host, src_port, dest_src, dest_port, protocol, time), ... ] etc now i need to find all the items in the second list where either src_

dicts vs classes

2006-07-25 Thread Guyon Morée
Hi all, I'm using simple classes as a container of named values and I'm instantiating a lot of them in a very short time. i was wondering if there is any benefit in using dicts instead from a performance/memory usage point of view? regards, Guyon Morée http://gumuz.looze.net

Re: web.py + cheetah delivering incomplete pages

2006-02-03 Thread Guyon Morée
hi, i think you'd have better luck at http://groups.google.com/group/webpy -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about re.sub and callables

2005-12-29 Thread Guyon Morée
Thanks, I just *assumed* I needed the globals to reach the vars in the nested function. This makes my code a l ot cleaner :) cheers, Guyon Morée http://gumuz.looze.net/ -- http://mail.python.org/mailman/listinfo/python-list

Question about re.sub and callables

2005-12-29 Thread Guyon Morée
-------- Is there any other way to do this? cheers, Guyon Morée http://gumuz.looze.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Draw over video

2005-12-28 Thread Guyon Morée
hi, i used pygame to display video and draw over it. check out: http://gumuz.looze.net/wordpress/index.php/archives/2005/06/06/python-webcam-fun-motion-detection/ cheers, http://gumuz.looze.net -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-27 Thread Guyon Morée
So, is an ugly short one a candidate? i managed in 199 bytes :) i'll send it in anyway ciao http://gumuz.looze.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Huffman encoding

2004-11-30 Thread Guyon Morée
Wow Paul! thanks a lot for your comments! I learned a lot already only by reading them, I will implement them and see what the speed gains are. Keep an eye on my blog, I will post an update on it soon! thanks, guyon ps. love this group "Paul McGuire" <[EMAIL PROTECTED]> wrote in message > h