It seems to me that what you need is this.
http://www.python.net/crew/mhammond/win32/Downloads.html
I think the key that you are missing here is that python does not include
functions that you ask without downloading something special. Check the
link, download those extensions, and read the docu
"elis aeris" <[EMAIL PROTECTED]>
>I need some of a something to be imported into python
Maybe.
> these are the functions I need, anyway know anything that might do
> any of
> the following?
Assuming you are still talking about Windows XP...
> suppose the class' name is autowindow:
What kind
I need some of a something to be imported into python
these are the functions I need, anyway know anything that might do any of
the following?
Eg:
suppose the class' name is autowindow:
autowindow.gainfocus(handle)
put the window of that handle into focus.
import autowindow
autowindow.im
On Jul 1, 2007, at 7:13 PM, elis aeris wrote:
might just end my quest for
optimized python source code.
ugh,
what does it mean ?
elias,
We have two MAJOR rules regarding optimization. These rules really
go beyond python, but this is a good place to learn them.
The two rules of optimi
oh i want to bring something up, there is this one line which i think is
suggesting that there is a way to use this object that the document says
it's a lot faster than getdata and getpixel.
*im.load()*
Allocates storage for the image and loads it from the file (or from the
source, for lazy op
in that case, can we talk about what this is?
import array
def f7(list):
return array.array('B', list).tostring()
f7([97, 98, 99])
Out[6]:'abc'
It's only one line, and it's faster than for(), getting through this one
might just end my quest for
optimized python source code. (then i ll be
elis aeris wrote:
> no, this one:
>
>
>
> In [4]:import array
>
> In [5]:def f7(list):
> .5.: return array.array('B', list).tostring()
> .5.:
>
> In [6]:f7([97, 98, 99])
> Out[6]:'abc'
That has nothing at all to do with reading lines of a file. It is the
fastest way to solve one particu
elis aeris wrote:
> I found out that by making a copy of it, it can be load() ed !
ImageGrab returns an image instance.
You can get the pixel data directly using getdata().
There's no reason to do what you're doing.
-Luke
___
Tutor maillist - Tutor@pyt
I found out that by making a copy of it, it can be load() ed !
it runs 3 times faster now
import time
import ImageGrab
from ctypes import *
class RECT(Structure):
_fields_ = [
('left', c_ulong),
('top', c_ulong),
('right', c_ulong),
('bottom', c_ulong)
]
GetFor
The for version, as claimed by
http://www.python.org/doc/essays/list2str.html
The fastest version of the algorithm is this one:
In [4]:import array
In [5]:def f7(list):
.5.: return array.array('B', list).tostring()
.5.:
In [6]:f7([97, 98, 99])
Out[6]:'abc'
___
no, this one:
In [4]:import array
In [5]:def f7(list):
.5.: return array.array('B', list).tostring()
.5.:
In [6]:f7([97, 98, 99])
Out[6]:'abc'
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Alan Gauld wrote:
> "Robert Hicks" <[EMAIL PROTECTED]> wrote
>> This is the loop code:
>>
>> for line in f2:
>> for id in idList:
>> if id in line:
>> print "%s: %s" % (id, f2.next())
>> found = "%s: %s" % (id, f2.next())
>> f3.write(found)
>>
>
> W
"Robert Hicks" <[EMAIL PROTECTED]> wrote
> This is the loop code:
>
> for line in f2:
> for id in idList:
> if id in line:
> print "%s: %s" % (id, f2.next())
> found = "%s: %s" % (id, f2.next())
> f3.write(found)
>
While I note that you got a sol
Kent Johnson wrote:
> Robert Hicks wrote:
>> Kent Johnson wrote:
>>> Robert Hicks wrote:
idList only has about 129 id numbers in it.
>>> That is quite a few times to be searching each line of the file. Try
>>> using a regular expression search instead, like this:
>>>
>>> import re
>>> regex =
Robert Hicks wrote:
> Kent Johnson wrote:
>> Robert Hicks wrote:
>>> idList only has about 129 id numbers in it.
>> That is quite a few times to be searching each line of the file. Try
>> using a regular expression search instead, like this:
>>
>> import re
>> regex = re.compile('|'.join(idList))
Kent Johnson wrote:
> Robert Hicks wrote:
>> idList only has about 129 id numbers in it.
>
> That is quite a few times to be searching each line of the file. Try
> using a regular expression search instead, like this:
>
> import re
> regex = re.compile('|'.join(idList))
> for line in f2:
>if
Also since you're writing your found results to a file there's no need to
print the results to the screen. That should shave off some time,
especially if you have a lot of hits.
On 6/26/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
Robert Hicks wrote:
> idList only has about 129 id numbers in it
On Tue, Jun 26, 2007 at 10:04:07AM -0400, Kent Johnson wrote:
> Robert Hicks wrote:
> > This is the loop code:
> >
> > for line in f2:
> > for id in idList:
> > if id in line:
> > print "%s: %s" % (id, f2.next())
> > found = "%s: %s" % (id, f2.next())
> >
Robert Hicks wrote:
> idList only has about 129 id numbers in it.
That is quite a few times to be searching each line of the file. Try
using a regular expression search instead, like this:
import re
regex = re.compile('|'.join(idList))
for line in f2:
if regex.search(line):
# process a h
Kent Johnson wrote:
> Robert Hicks wrote:
>> This is the loop code:
>>
>> for line in f2:
>> for id in idList:
>> if id in line:
>> print "%s: %s" % (id, f2.next())
>> found = "%s: %s" % (id, f2.next())
>> f3.write(found)
>>
>>
>> I have an list,
Robert Hicks wrote:
> This is the loop code:
>
> for line in f2:
> for id in idList:
> if id in line:
> print "%s: %s" % (id, f2.next())
> found = "%s: %s" % (id, f2.next())
> f3.write(found)
>
>
> I have an list, idList[], that contains a lis
Kent Johnson wrote:
> Robert Hicks wrote:
>> I have a script at work where I have a list of id numbers and I am doing a:
>>
>> for line in ehFile:
>
> That is fine
>
>> for id in line:
>
> I don't know what this is for - line is a string, iterating it will give
> you every character is the
Robert Hicks wrote:
> I have a script at work where I have a list of id numbers and I am doing a:
>
> for line in ehFile:
That is fine
> for id in line:
I don't know what this is for - line is a string, iterating it will give
you every character is the line.
>
> I am then going thr
I have a script at work where I have a list of id numbers and I am doing a:
for line in ehFile:
for id in line:
I am then going through that file and finding the line the id is on and
printing the next line out. It takes a few seconds to see the output to
the screen (the Perl versi
24 matches
Mail list logo