That works perfectly thank you.
Bruno Desthuilliers wrote:
> EdG a écrit :
> (top-post corrected)
> >
> > Neil Cerutti wrote:
> >
> >>On 2007-01-18, EdG <[EMAIL PROTECTED]> wrote:
> >>
> >>>For debugging purposes, I would like to traverse the class
> >>>listing out all the properties.
> >>
> >>Thi
John try this:
from M2Crypto import SSL
That should put your SSL module in the namespace as you want.
--gordy
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Steven Bethard:
>> Antoon Pardon:
>>> For me, your class has the same drawback as the heappush, heappop
>>> procedurers: no way to specify a comparision function.
>> Agreed. I'd love to see something like ``Heap(key=my_key_func)``.
>
> It can be done, but the code becom
[EMAIL PROTECTED] wrote:
> [EMAIL PROTECTED] wrote:
> [...]
>
> Ask yourself, how can all these people, supposed physicists, engineers,
> software developers, people of supposed intelligence be incapable of
> understanding that fire cannot make buildings free fall? How can they
> not understand th
Ron Adam wrote:
> Is there a function to find a filename from a dotted module (or package) name
> without importing it?
>
> The imp function find_module() doesn't work with dotted file names. And it
> looks like it may import the file as it raises an ImportError error exception
> if
> it ca
thanks Gabriel
> str(key)[7:-2] => key.__name__
I didn't know that one
> Nice to see you built a useful tool! It's a great way to learn a language.
Yes, and this group is helping me a whole lot, thanks !
cheers,
Stef Mientki
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Nick Maclaren) wrote:
> In article <[EMAIL PROTECTED]>,
> Donn Cave <[EMAIL PROTECTED]> writes:
> |> In article <[EMAIL PROTECTED]>,
> |> "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> |> > "Tom Wright" <[EMAIL PROTECTED]> escribió en el mensaj
Steven Bethard wrote:
> The current code fails when using unbound methods however::
I don't like your solution, this class was already slow enough. Don't
use unbound methods with this class :-)
Maybe there's a (better) solution to your problem: to make Heap a
function (or classmethod) that return
Hi,
There are better places to find me then on comp.lang.python (just too
much traffic for me)
pywinauto forums: http://forums.openqa.org/forum.jspa?forumID=15
or subscribe pywinauto mailing list:
https://lists.sourceforge.net/lists/listinfo/pywinauto-users
vithi wrote:
> MatchError: Could not
In article <[EMAIL PROTECTED]>,
Donn Cave <[EMAIL PROTECTED]> writes:
|> > |>
|> > |> O_EXCL fails if the file exists at all - whether closed or open.
|> >
|> > Yes. In theory. In practice, it usually works on normal files, provided
|> > that all opens are local. Under some circumstances, it
Gabriel Genellina wrote:
> At Tuesday 16/1/2007 16:36, Bill Mill wrote:
>
> > > py> import re
> > > py> rgx = re.compile('1?')
> > > py> rgx.search('a1').groups()
> > > (None,)
> > > py> rgx = re.compile('(1)+')
> > > py> rgx.search('a1').groups()
> >
> >But shouldn't the ? be greedy, and thus pre
On Thursday 18 January 2007 10:13, robert wrote:
> stay with py23 for "a script" (and more) and make <700kB
> independent distros - UPX and 7zip involved:
>
> http://groups.google.com/group/comp.lang.python/msg/edf469a1b3dc3802
Thanks, that might be an option. But I might just convince the person
Often I need to tell the len of an iterator, this is a stupid example:
>>> l = (i for i in xrange(100) if i&1)
len isn't able to tell it:
>>> len(l)
Traceback (most recent call last):
File "", line 1, in
TypeError: object of type 'generator' has no len()
This is a bad solution, it may need t
[EMAIL PROTECTED] wrote:
> Steven Bethard wrote:
>> The current code fails when using unbound methods however::
>
> I don't like your solution, this class was already slow enough. Don't
> use unbound methods with this class :-)
> Maybe there's a (better) solution to your problem: to make Heap a
>
Nick Maclaren wrote:
>
> In article <[EMAIL PROTECTED]>,
> hg <[EMAIL PROTECTED]> writes:
> |>
> |> I posted an equivalent question earlier ... but am still not sure:
> |>
> |> I currently (under Linux) have a program that uses Queue.put
> |> (raw_input('')) in a signal handler and Queue.get()
Hi
Am pretty new to python and hence this question..
I have file with an output of a process. I need to search this file one
line at a time and my pattern is that I am looking for the lines that
has the word 'event' and the word 'new'.
Note that i need lines that has both the words only and not
Steven Bethard <[EMAIL PROTECTED]> writes:
> Heap(sequence=None, inplace=False)
> KeyedHeap(key, sequence=None)
> Of course, this approach ends up with a bunch of code duplication again.
Maybe there's a way to use a metaclass that can make either type of
heap but they'd share most method
[EMAIL PROTECTED] wrote:
> [EMAIL PROTECTED] wrote:
> > [EMAIL PROTECTED] wrote:
> > [...]
> >
> > Ask yourself, how can all these people, supposed physicists, engineers,
> > software developers, people of supposed intelligence be incapable of
> > understanding that fire cannot make buildings free
Hi,
I have an application consisting of a main C++ class (and other
classes) stored inside a DLL. The application uses a small main
executable that links against the main DLL, then initializes and runs
the core class. The python bindings are inside a .pyd module that also
links against the core
[EMAIL PROTECTED] wrote:
> Hi
>
> Am pretty new to python and hence this question..
>
> I have file with an output of a process. I need to search this file one
> line at a time and my pattern is that I am looking for the lines that
> has the word 'event' and the word 'new'.
>
> Note that i need lin
Hi
Does anybody know how to pass multiple arguments to the function
tested in timeit.timer() in
python?
I googled and found how to pass one argument:
x=1
mytime = timeit.Timer( setup="from Createlst import createlst", stmt=
"createlst(%s)"%(x) )
But how can I extend it to two or more
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I have an array of 2 ComboBoxes. I would like to use lambda to report
on which widget is being accessed. When I use arrays of other widgets I
just use lambda to return which item I am using as an argument. This
does not seem to work with ComboBox, the only thing returned is the
value changed.
[EMAIL PROTECTED] wrote:
> Often I need to tell the len of an iterator, this is a stupid example:
>
> >>> l = (i for i in xrange(100) if i&1)
>
> len isn't able to tell it:
>
> >>> len(l)
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: object of type 'generator' has no l
David Bostwick wrote:
> In article <[EMAIL PROTECTED]>, "Robert Hicks" <[EMAIL PROTECTED]> wrote:
> >Please, none of the real facts points to anything else except what
> >actually happened. Two planes hit two towers and they came down.
> >
>
> You're talking to the wind. This is a conspiracy prec
George Sakkis:
> Is this a rhetorical question ? If not, try this:
It wasn't a rhetorical question.
> >>> x = (i for i in xrange(100) if i&1)
> >>> if leniter(x): print x.next()
What's your point? Maybe you mean that it consumes the given iterator?
I am aware of that, it's written in the functi
Willie wrote:
> Hi,
>
> I have an array of 2 ComboBoxes. I would like to use lambda to report
> on which widget is being accessed. When I use arrays of other widgets I
> just use lambda to return which item I am using as an argument. This
> does not seem to work with ComboBox, the only thing retur
Silly question, but here goes... what's a good way to determine when a
file is an Open Office document? I could look at the file extension, but
it seems there would be a better way. VI shows this info in the files:
mimetypeapplication/vnd.oasis.opendocument.textPK
mimetypeapplication/vnd.oasis.o
[EMAIL PROTECTED] writes:
> But sometimes you don't need the elements of a given iterator, you
> just need to know how many elements it has.
AFAIK, the iterator protocol doesn't allow for that.
Bear in mind, too, that there's no way to tell from outside that an
iterater even has a finite length;
tubby <[EMAIL PROTECTED]> writes:
> Silly question, but here goes... what's a good way to determine when
> a file is an Open Office document? I could look at the file
> extension, but it seems there would be a better way.
Yes, the name of a file may be useful for communicating with humans
about t
I will post a sample tomorrow AM.
James Stroud wrote:
> Can you show us your code? Your question is ambiguous to me. Comboboxes
> do not hold widgets but display text.
--
http://mail.python.org/mailman/listinfo/python-list
tubby wrote:
> Silly question, but here goes... what's a good way to determine when a
> file is an Open Office document? I could look at the file extension, but
> it seems there would be a better way. VI shows this info in the files:
>
> mimetypeapplication/vnd.oasis.opendocument.textPK
It's a ZIP
tubby wrote:
> Silly question, but here goes... what's a good way to determine when a
> file is an Open Office document? I could look at the file extension, but
> it seems there would be a better way. VI shows this info in the files:
>
> mimetypeapplication/vnd.oasis.opendocument.textPK
It's a ZIP
Without using re, this may work (untested ;-):
def lines_with_words(file, word1, word2):
"""Print all lines in file that have both words in it."""
for line in file:
words = line.split()
if word1 in words and word2 in words:
print line
/Jean Brouwers
Rickard
MrJean1 wrote:
> def lines_with_words(file, word1, word2):
> """Print all lines in file that have both words in it."""
> for line in file:
> words = line.split()
> if word1 in words and word2 in words:
> print line
This sounds better, it's probably faster than t
At Thursday 18/1/2007 04:41, John Nagle wrote:
I've been running M2Crypto successfully using Python 2.4 on Windows 2000,
and now I'm trying to get it to work on Python 2.3.4 on Linux.
Attempting to initialize a context results in
Traceback (most recent call last):
File "/www/htdocs/si
I see two potential problems with the non regex solutions.
1) Consider a line: "foo (bar)". When you split it you will only get
two strings, as split by default only splits the string on white space
characters. Thus "'bar' in words" will return false, even though bar is
a word in that line.
2) If
Hi All
I am trying to subclass an extension type in Python and add attributes
to the new class but I keep getting errors. I read the "Extension
Types" document on the Pyrex website but I couldn't get an answer from
it.
Here's the Spam extension type from Pyrex website:
cdef class Spam:
cdef i
On Jan 18, 2:19 pm, Rikishi 42 <[EMAIL PROTECTED]> wrote:
> On Thursday 18 January 2007 10:13, robert wrote:
>
> > stay with py23 for "a script" (and more) and make <700kB
> > independent distros - UPX and 7zip involved:
>
> >http://groups.google.com/group/comp.lang.python/msg/edf469a1b3dc3802Tha
At Thursday 18/1/2007 19:24, Stef Mientki wrote:
> str(key)[7:-2] => key.__name__
I didn't know that one
It's here: http://docs.python.org/lib/specialattrs.html
--
Gabriel Genellina
Softlab SRL
__
Pregun
At Thursday 18/1/2007 20:26, [EMAIL PROTECTED] wrote:
def leniter(iterator):
"""leniter(iterator): return the length of an iterator,
consuming it."""
if hasattr(iterator, "__len__"):
return len(iterator)
nelements = 0
for _ in iterator:
nelements += 1
retu
Ross Ridge wrote:
> tubby wrote:
>> Silly question, but here goes... what's a good way to determine when a
>> file is an Open Office document? I could look at the file extension, but
>> it seems there would be a better way. VI shows this info in the files:
>>
>> mimetypeapplication/vnd.oasis.opendo
At Thursday 18/1/2007 21:31, Dongsheng Ruan wrote:
Does anybody know how to pass multiple arguments to the function
tested in timeit.timer() in
python?
I googled and found how to pass one argument:
x=1
mytime = timeit.Timer( setup="from Createlst import createlst", stmt=
"createlst(%
Please help with this script:
class ShortInputException(Exception):
'''A user-defined exception class.'''
def __init__(self,length,atleast):
Exception.__init__(self)
self.length=length
self.atleast=atleast
try:
s=raw_input('E
Jm lists wrote:
> Please help with this script:
>
> class ShortInputException(Exception):
> '''A user-defined exception class.'''
> def __init__(self,length,atleast):
> Exception.__init__(self)
> self.length=length
> self.atleast=atle
Suppose I have 3 modules that belong to a project, 'A', 'A.a' and 'B',
and each module has its own logger, created with:
module1logger = logging.getLogger('project.A')
and
module2logger = logging.getLogger('project.A.a')
and
module3logger = logging.getLogger('project.B')
And I want to select
101 - 146 of 146 matches
Mail list logo