[Tutor] 200 dollar questions!

Luke Paireepinart rabidpoobear at gmail.com
Sun Jul 1 05:10:38 CEST 2007


elis aeris wrote:
> I ran this:
>
[snip a lot of code]
In the future, please send big sections of code as attachments.
It is better in the regard that formatting is preserved as well as
us not having to scroll down past a bunch of code to see what the issue is.
Often, with just the traceback and an explanation of what the code is 
supposed to do,
we already have a general idea of what the problem is, and probably 
where it is as well,
and we can locate and explain the problem quickly.
If we have to look through all the code before we know what the issue 
is, chances are,
you will have fewer people willing to respond.
>
> What that does is to take a screen shot and then pixelgetcolor() over 
> 8000  (x,y)  points
No it doesn't.
It gets the same pixel 8000 times.
What exactly are you trying to accomplish here?
In addition, the PIL manual mentions specifically that the 
image.getpixel method is slow,
and if you need to process portions of the image you should go about it 
in a different manner.
>
> for me it clocked at 0.08 seconds and I am trying cut it down to maybe 
> 0.04 
For something that executes this fast, I would suggest using a more 
accurate method of timing it.
For example, using the timeit module and getting an average of 1,000 
iterations, or something of that nature.
>
> any hints on performance increase?
It depends what you're trying to do.  Give us more info and we can help.
-Luke


More information about the Tutor mailing list