Re: [Tutor] 200 dollar questions!

2007-06-30 Thread Luke Paireepinart
elis aeris wrote: > which modules and origin is this function? You can infer from the fact that your image object already has the pixel data stored within it that the getdata would be a method of the object. In other words, just call image.getdata() and, if I recall correctly, when you asked where

Re: [Tutor] optimization: faster than for

2007-06-30 Thread elis aeris
oh yeah, he said getdata() but i don't know where it comes from and image.getpixel((10, 12)) is from http://www.pythonware.com/products/pil/ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] optimization: faster than for

2007-06-30 Thread elis aeris
x = 0 y = 0 for x in xrange(1,1024,1): for y in xrange(1,768,1): rgb = image.getpixel((10, 12)) Luke said there is a faster way to do image.getpixel((10, 12)) so i am still waiting on that, the above has been improved many times and it's a lot faster than while, I am trying to find

Re: [Tutor] optimization: faster than for

2007-06-30 Thread Kent Johnson
elis aeris wrote: > my question, is there any other way to make it run faster, > > as described in the webpage, it's possible to use map() but I don't > know how to do it with this one, 2 dimensional arrays. How about number_scanned = 1024 * 768 ? But seriously, the example you gave doesn't do

Re: [Tutor] optimization: faster than for

2007-06-30 Thread elis aeris
my question, is there any other way to make it run faster, as described in the webpage, it's possible to use map() but I don't know how to do it with this one, 2 dimensional arrays. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman

Re: [Tutor] optimization: faster than for

2007-06-30 Thread elis aeris
The for version, as claimed by http://www.python.org/doc/essays/list2str.html ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] optimization: faster than for

2007-06-30 Thread Kent Johnson
elis aeris wrote: > I found this on the net, and it's a different arrangement to using for > > the author claims it will result in faster performance, but i can't find > documents on it, because I can't figure out which parts are parameters > and which parts on special words, for python. Where

[Tutor] optimization: faster than for

2007-06-30 Thread elis aeris
I found this on the net, and it's a different arrangement to using for the author claims it will result in faster performance, but i can't find documents on it, because I can't figure out which parts are parameters and which parts on special words, for python. The operations with explicit loop co

Re: [Tutor] 200 dollar questions!

2007-06-30 Thread elis aeris
which modules and origin is this function? is it the fastest way to get it? I am told to optimize getpixel (x, y) alone, so that's the only thing i am trying, it's part of a project that will go live in september, so the prof we are under hasn't one anything but some introductory readings.

Re: [Tutor] 200 dollar questions!

2007-06-30 Thread Luke Paireepinart
elis aeris wrote: > Yes, I am trying to write a OCR algorithm with neural network, but the > theories of NN is of little importance, what I am trying to get ready > for the project is run speed. Yes, but what you're trying to do _is_ important. Example code that just loops over a small part of an

Re: [Tutor] 200 dollar questions!

2007-06-30 Thread elis aeris
Yes, I am trying to write a OCR algorithm with neural network, but the theories of NN is of little importance, what I am trying to get ready for the project is run speed. the problem comes in a number of ways: first, as you mentioned, image.getpixel is not very fast, according to PIL http

Re: [Tutor] 200 dollar questions!

2007-06-30 Thread Luke Paireepinart
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

Re: [Tutor] 200 dollar questions!

2007-06-30 Thread elis aeris
I ran this: import time import ImageGrab # Part of PIL from ctypes import * # Load up the Win32 APIs we need to use. class RECT(Structure): _fields_ = [ ('left', c_ulong), ('top', c_ulong), ('right', c_ulong), ('bottom', c_ulong) ] time.sleep(2) GetForegroundWindow = windl

[Tutor] Help search file

2007-06-30 Thread Alejandro Decchi
Hello Python user. I am a newbie with python and i am interesting to do a web apliation to search file on the hard disk and give a link to download the file found. Someone can give a help ??? Thz Ale ___ Tutor maillist - Tutor@python.org http://mail.py

Re: [Tutor] 200 dollar questions!

2007-06-30 Thread elis aeris
import win32api import win32ui window = win32ui.FindWindow(None, "123.txt") yourwindow.ShowWindow() Traceback (most recent call last): File "C:/python codes/gain_focus.py", line 3, in window = win32ui.FindWindow(None, "123.txt") win32ui: No window can be found. __

Re: [Tutor] Mouse clicking

2007-06-30 Thread Alan Gauld
"elis aeris" <[EMAIL PROTECTED]> wrote in > It's very cryptic to me and more or less is not explained in any > python > tutorials. > > http://search.msdn.microsoft.com/search/results.aspx?view=msdn&qu=mouse_event > http://search.msdn.microsoft.com/search/results.aspx?view=msdn&qu=keybd_event > ht

Re: [Tutor] 200 dollar questions!

2007-06-30 Thread Alan Gauld
"elis aeris" <[EMAIL PROTECTED]> wrote > I am using pywin32, for python 2.5 on windows xp. > What I want to do is these: > > handle = Gethandle ("window_name") Try FindWindow(), it returns a handle given a class/window title > "window_name" = "123.txt" with notepad, for example. That looks

Re: [Tutor] 200 dollar questions!

2007-06-30 Thread elis aeris
http://search.msdn.microsoft.com/search/results.aspx?view=msdn&qu=mo use_event http://search.msdn.microsoft.com/search/results.aspx?view=msdn&qu=ke ybd_event

Re: [Tutor] Mouse clicking

2007-06-30 Thread elis aeris
can you take a look of these? It's very cryptic to me and more or less is not explained in any python tutorials. http://search.msdn.microsoft.com/search/results.aspx?view=msdn&qu=mouse_event http://search.msdn.microsoft.com/search/results.aspx?view=msdn&qu=keybd_event http://search.msdn.micro

Re: [Tutor] Mouse clicking

2007-06-30 Thread Alan Gauld
"elis aeris" <[EMAIL PROTECTED]> wrote > BOOL EnumWindows( >WNDENUMPROC lpEnumFunc, // pointer to callback function >LPARAM lParam // application-defined value > ); > > I am not sure what this is for @_@ If you don't know the window class/title in advance you can get a list of all o

Re: [Tutor] Mouse clicking

2007-06-30 Thread elis aeris
Bit torrent .torrent file aquisition assistance. Given a webpage of forum threads that links to download links of .torrent files, the code should download every .torrent files it can find within 2 levels of connections. Bit torrent high performance client Given that popular bit torrent clien

Re: [Tutor] Mouse clicking

2007-06-30 Thread elis aeris
win32gui .FindWindow int = *FindWindow(className, WindowName *) Retrieves a handle to the top-level window whose class name and window name match the specified strings. Parameters *className* : int/string *WindowName* : string HWND FindWindow( LPCTSTR lpClassName, // pointer to class name

Re: [Tutor] Mouse clicking

2007-06-30 Thread elis aeris
what module should be imported? On 6/30/07, Alan Gauld <[EMAIL PROTECTED]> wrote: "Lisa Barrott" <[EMAIL PROTECTED]> wrote > I was wondering if there was any way to force a mouse click at a set > location using python even when the another window is focussed. > I'm using Windows XP Yes, you

Re: [Tutor] Mouse clicking

2007-06-30 Thread Alan Gauld
"Lisa Barrott" <[EMAIL PROTECTED]> wrote > I was wondering if there was any way to force a mouse click at a set > location using python even when the another window is focussed. > I'm using Windows XP Yes, you can use the Win32 API. You need to get the target window handle with - HW

[Tutor] Mouse clicking

2007-06-30 Thread Lisa Barrott
Hello I was wondering if there was any way to force a mouse click at a set location using python even when the another window is focussed. I'm using Windows XP. -Lawrence ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/t

Re: [Tutor] 200 dollar questions!

2007-06-30 Thread Jeff Johnson
___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] 200 dollar questions!

2007-06-30 Thread Alan Gauld
> http://www.eternite.co.uk/web_page/python_tutor_example.zip > > that's the anwser i got from a questions, I had a look but it didn't show up too well. It seems to relate to a question about mouse events in a web page? > because i was determined to go unstuck from this bunch > that has entangl

Re: [Tutor] 200 dollar questions!

2007-06-30 Thread ALAN GAULD
Returning it to the List - Original Message http://www.eternite.co.uk/web_page/python_tutor_example.zip that's the anwser i got from a questions, because i was determined to go unstuck from this bunch that has entangled me for two days, i was willing to pay for a timely answer.

Re: [Tutor] 200 dollar questions!

2007-06-30 Thread Alan Gauld
"elis aeris" <[EMAIL PROTECTED]> wrote >I am a 4 day python newbie, and already I am writing practical codes. > > I want to learn as fast as possible so I am willing to pay for some > tutorials. > > Please reply if you are interested, although 200 is not a lot of > money. I'm not sure exactly wha