On Feb 26, 2:01 pm, Kirk Sluder <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> Christian Sonne <[EMAIL PROTECTED]> wrote:
>
> > Thanks to all of you for your replies - they have been most helpful, and
> > my program is now running at a reasonable pace...
>
> > I ended up using r"\
Virgil Dupras:
> Without the call example, I would have
> had a hard time to try to figure out what these extra brackets are
> for. For this reason, I think that an explicit unpack is more
> readable, and thus better.
I can't agree.
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/py
En Sat, 24 Feb 2007 01:42:00 -0300, Martin Manns <[EMAIL PROTECTED]> escribió:
> On Fri, 23 Feb 2007 20:20:12 -0300
> "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
>
>> mx.Number.Rational is horribly broken. They break this rule:
>> a==b => hash(a)==hash(b)
>> so they can'b be used as dictionary
On Mon, 26 Feb 2007 07:15:43 +0200, Hendrik van Rooyen wrote:
> "James Stroud" <[EMAIL PROTECTED]> wrote:
>
>
>> Clement wrote:
>> > Can any body tell how Dict is implemented in python... plz tell what
>> > datastructure that uses
>> >
>>
>> I think it uses a dict.
>
> "Groan
Hi,
i am working with jsp ..
i wanna help regarding how to import or how to call python modules to
jsp
if a piece of code is availabe will be very helpful for me
chandra
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
i am working with jsp ..
i wanna help regarding how to import or how to call python modules to
jsp
if a piece of code is availabe will be very helpful for me
chandra
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Genellina wrote:
> En Sun, 25 Feb 2007 19:07:38 -0300, John Nagle <[EMAIL PROTECTED]>
> escribió:
>
>> Is there some way to get a strong ref to the original object back
>> from a weakref proxy object? I can't find any Python function to do
>> this.
>> ".ref()" doesn't work on prox
"Arnaud Delobelle" <[EMAIL PROTECTED]> wrote:
> On Feb 25, 6:00 pm, "Paddy" <[EMAIL PROTECTED]> wrote:
> > I blogged on finding a new-to-me feature of Python, in that you are
> > allowed to nnest parameter definitions:
> >
> > >>> def x ((p0, p1), p2):
> >
> > ... return p0,p1,p2
> > ...>>> x
"hg" <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
>
> > Hello everybody,
> >
> > I have a (hopefully) simple question about scoping in python. I have a
> > program written as a package, with two files of interest. The two
> > files are /p.py and /lib/q.py
Make a third file for all th
"James Stroud" <[EMAIL PROTECTED]> wrote:
> Clement wrote:
> > Can any body tell how Dict is implemented in python... plz tell what
> > datastructure that uses
> >
>
> I think it uses a dict.
"Groan!" - this answer is like Microsoft documentation -
while technically correct,
http://www.smartcharter.com/jobs.html
Smart Charter Inc. is a dynamic new startup company aiming to
revolutionize the purchase and sale of private aviation services. If you
are ready for a challenging ground-floor opportunity with significant
upside potential you've come to the right place. We
In article <[EMAIL PROTECTED]>,
Christian Sonne <[EMAIL PROTECTED]> wrote:
> Thanks to all of you for your replies - they have been most helpful, and
> my program is now running at a reasonable pace...
>
>
> I ended up using r"\b\d{9}[0-9X]\b" which seems to do the trick - if it
> turns out t
En Sun, 25 Feb 2007 19:07:38 -0300, John Nagle <[EMAIL PROTECTED]>
escribió:
> Is there some way to get a strong ref to the original object back
> from a weakref proxy object? I can't find any Python function to do
> this.
> ".ref()" doesn't work on proxy objects.
Add a method to the ori
On Feb 25, 5:12 pm, [EMAIL PROTECTED] wrote:
> consider the following working loop where Packet is a subclass of
> list, with Packet.insert(index, iterable) inserting each item in
> iterable into Packet at consecutive indexes starting at index.
>
> i=0
> while(i if packet[i:i+5]==Pa
On Feb 25, 8:12 pm, [EMAIL PROTECTED] wrote:
> consider the following working loop where Packet is a subclass of
> list, with Packet.insert(index, iterable) inserting each item in
> iterable into Packet at consecutive indexes starting at index.
>
> i=0
> while(i if packet[i:i+5]==Pa
On 2007-02-26, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2007-02-26, jeff <[EMAIL PROTECTED]> wrote:
>
>> I looked around a lot on the internet and couldn't find out how to do
>> this, how do I get the sizer (in rows and columns) of the view?
>
> You use the TIOCGWINSZ ioctl() call on the tty d
On 2007-02-26, jeff <[EMAIL PROTECTED]> wrote:
> I looked around a lot on the internet and couldn't find out how to do
> this, how do I get the sizer (in rows and columns) of the view?
You use the TIOCGWINSZ ioctl() call on the tty device in question.
import termios, fcntl, struct, sys
s =
On 25 Feb 2007 16:53:17 -0800, jeff <[EMAIL PROTECTED]> wrote:
>I looked around a lot on the internet and couldn't find out how to do
>this, how do I get the sizer (in rows and columns) of the view?
>
Assuming you're talking about something vaguely *NIXy, you want something
like what's being done
Diez B. Roggisch wrote:
> Niclas schrieb:
>
>> Thank you!
>>
>> solved it with this:
>> unicode( data.decode('latin_1') )
>
>
> The unicode around this is superfluous.
Worse, it's an error. utf-8 needs to go into a stream
of 8-bit bytes, not a Unicode string.
En Sun, 25 Feb 2007 15:00:31 -0300, Paddy <[EMAIL PROTECTED]>
escribió:
def x ((p0, p1), p2):
> ... return p0,p1,p2
The first time I saw it used was in Zope, a long time ago. And I like it.
Of course it only has any sense if you expect the tuple (p0,p1) to exist
*before* the functi
Dennis Lee Bieber wrote:
> On 25 Feb 2007 05:31:11 -0800, "John Machin" <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>> Evidently not; here's some documentation we both need(ed) to read:
>>
>> http://docs.python.org/tut/node16.html
>> """
>> Almost all machines today (Novem
consider the following working loop where Packet is a subclass of
list, with Packet.insert(index, iterable) inserting each item in
iterable into Packet at consecutive indexes starting at index.
i=0
while(ihttp://mail.python.org/mailman/listinfo/python-list
On Sun, 25 Feb 2007 16:57:25 -0800, jeff wrote:
print {}.update.__doc__
That's a long way to spell "help({}.update)"
:-)
--
Steven D'Aprano
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 25 Feb 2007 18:49:56 -0600, S.Mohideen wrote:
asd={}
asd={1:2,3:4,4:5}
You don't need to initialise asd to an empty dict.
print asd
> {1: 2, 3: 4, 4: 5}
>
asd.has_key(3)
> True
asd.update()
print asd
> {1: 2, 3: 4, 4: 5}
You're not updating it with anythi
On Feb 25, 7:49 pm, "S.Mohideen" <[EMAIL PROTECTED]>
wrote:
>...
>
> what does asd.update() signifies. What is the use of it. Any comments would
> help to understand it.
>
> Thanks
> Mohideen
>>> print {}.update.__doc__
D.update(E, **F) -> None. Update D from E and F: for k in E: D[k] =
E[k]
(if
I looked around a lot on the internet and couldn't find out how to do
this, how do I get the sizer (in rows and columns) of the view?
--
http://mail.python.org/mailman/listinfo/python-list
>>> asd={}
>>> asd={1:2,3:4,4:5}
>>> print asd
{1: 2, 3: 4, 4: 5}
>>> asd.has_key(3)
True
>>> asd.update()
>>> print asd
{1: 2, 3: 4, 4: 5}
>>>
what does asd.update() signifies. What is the use of it. Any comments would
help to understand it.
Thanks
Mohideen
--
http://mail.python.org/mailman
On Sun, 25 Feb 2007 11:06:03 -0800, Virgil Dupras wrote:
> On Feb 25, 1:00 pm, "Paddy" <[EMAIL PROTECTED]> wrote:
>> I blogged on finding a new-to-me feature of Python, in that you are
>> allowed to nnest parameter definitions:
>>
>> >>> def x ((p0, p1), p2):
>>
>> ... return p0,p1,p2
[snip]
On Sun, 25 Feb 2007 10:00:31 -0800, Paddy wrote:
> I wondered if those of you with some Python experience new of nested
> parameters and don't use them; or just forgot/don't know it is
> possible?
I learnt about this some time ago. I don't often use it, although it makes
sense to write this:
def
On 2007-02-25, Jussi Salmela <[EMAIL PROTECTED]> wrote:
> I'm nitpicking, but the OP has a list of tuples:
> ec = [ item[2:] for item in mainlist if item[:2] == ('eco','con') ]
Jussi,
An excellent nit to pick.
Thank you,
Rich
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-02-25, Paddy <[EMAIL PROTECTED]> wrote:
> You might also use list comprehensions to accumulate the values you
> need:
>
> ec = [ item[2:] for item in mainlist if item[:2] == ['eco','con'] ]
Thank you, Paddy. That's the syntax I couldn't work out myself.
Rich
--
http://mail.python.or
Can you access the c object of a python object directly? Can this be
done in ctypes or directly throught python functions without reverting
to forking the python module?
scanario:
I have pyctx object that i get in python like this:
pyctx = cairo.Context(surface)
defined in the python extension t
[EMAIL PROTECTED] wrote:
> gmpy itself is or should be pretty trivial to build on any platform
> (and I'll always happily accept any fixes that make it better on any
> specific platform, since it's easy to make them conditional so they'll
> apply to that platform only), but the underlying GMP is
John Nagle wrote:
> "weakref.proxy()" probably should work that way.
> Weakref proxies are supposed to be transparent, but they're not
> quite transparent enough.
Submit a patch to SourceForge. Please don't use tabs in email/usenet
postings - use 4-space indents. "return" is not a function, a
>
> Thank you for the advice, but that seems a bit unwieldy. My code will
> have about 10 of these global objects, all of which interact with
> eachother. It seems silly to have to pass 10 parameters around to each
> instance I work with. I hope there is a smarter way to do it, or
> perhaps someon
[EMAIL PROTECTED] writes:
> My code will have about 10 of these global objects, all of which
> interact with eachother. It seems silly to have to pass 10
> parameters around to each instance I work with.
Yes. A better solution would be to put them inside a module, and
import that module. Then the
Niclas schrieb:
> Thank you!
>
> solved it with this:
> unicode( data.decode('latin_1') )
The unicode around this is superfluous. Either do
unicode(bytestring, encoding)
or
bytestring.decode(encoding)
> and when I write it to the file...
> f = codecs.open(path, encoding='utf-8', mod
Is there some way to get a strong ref to the original object back
from a weakref proxy object? I can't find any Python function to do this.
".ref()" doesn't work on proxy objects.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 25, 9:37 am, hg <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Hello everybody,
>
> > I have a (hopefully) simple question about scoping in python. I have a
> > program written as a package, with two files of interest. The two
> > files are /p.py and /lib/q.py
>
> > My file p.py l
Thank you!
solved it with this:
unicode( data.decode('latin_1') )
and when I write it to the file...
f = codecs.open(path, encoding='utf-8', mode='w+')
f.write(self.__rssDoc.toxml())
Diez B. Roggisch skrev:
> Niclas schrieb:
>> Hi
>>
>> I'm having trouble to work with the spec
Hi there,
I'm pleased to announce a new release of Pynakotheka.
Pynakotheka is a simple GPL-licensed python script which generates
static HTML photo albums to be added to web sites or to be burnt into
CDs.
It includes some templates and it's easy to create more.
It depends on python, Mako Templa
[EMAIL PROTECTED] wrote:
> Hello everybody,
>
> I have a (hopefully) simple question about scoping in python. I have a
> program written as a package, with two files of interest. The two
> files are /p.py and /lib/q.py
>
> My file p.py looks like this:
>
> ---
>
> from lib import q
>
> def ma
Hello everybody,
I have a (hopefully) simple question about scoping in python. I have a
program written as a package, with two files of interest. The two
files are /p.py and /lib/q.py
My file p.py looks like this:
---
from lib import q
def main():
global r
r = q.object1()
s = q.object2()
Charles D Hixson wrote:
> I want to access the values via instances of the class, so your D().a
> approach isn't suitable. More like: "t = D(); t[a]"
Well, D() is an instance of D, so D().a is the same as t = D(); t.a
In fact the various "a" attributes I'm accessing are class attributes of
th
On Feb 25, 7:06 pm, "Virgil Dupras" <[EMAIL PROTECTED]>
wrote:
> On Feb 25, 1:00 pm, "Paddy" <[EMAIL PROTECTED]> wrote:
>
>
>
> > I blogged on finding a new-to-me feature of Python, in that you are
> > allowed to nnest parameter definitions:
>
> > >>> def x ((p0, p1), p2):
>
> > ... return p0,p
John Nagle wrote:
> Are weak refs slower than strong refs? I've been considering making the
> "parent" links in BeautifulSoup into weak refs, so the trees will release
> immediately when they're no longer needed. In general, all links back
> towards the root of a tree should be weak refs; this
[EMAIL PROTECTED] a écrit :
> While working with lists of tuples is probably very common, none of my
> five Python books or a Google search tell me how to refer to specific items
> in each tuple.
t = "a", "b", "c"
assert t[0] == "a"
assert t[1] == "b"
assert t[2] == "c"
> I find references to
> Can any body tell how Dict is implemented in python... plz tell what
> datastructure that uses
Please see
http://svn.python.org/view/python/trunk/Objects/dictnotes.txt?rev=53782&view=markup
for general notes and
http://svn.python.org/view/python/trunk/Objects/dictobject.c?rev=
Troy Melhase a écrit :
>> Why do people sometimes use one leading underscore?
>
>
> Many folks like to use the single leading underscore to emphasize that
> the attribute isn't part of the normal way to use the class or
> instance.
>
> It's bad style in my opinion, but I'm probably in the minori
On Feb 25, 5:44 pm, Jussi Salmela <[EMAIL PROTECTED]> wrote:
> Paddy kirjoitti:
>
>
>
> > On Feb 25, 2:01 am, [EMAIL PROTECTED] wrote:
> >> While working with lists of tuples is probably very common, none of my
> >> five Python books or a Google search tell me how to refer to specific items
> >>
Steven W. Orr a écrit :
> I understand that two leading underscores in a class attribute make the
> attribute private.
Nope. It doesn't make it "private", it mangles the attribute name with
the class name (ie : Bar.__mangled will become Bar._Bar__mangled
everywhere except inside Bar). This is
On Feb 25, 6:00 pm, "Paddy" <[EMAIL PROTECTED]> wrote:
> I blogged on finding a new-to-me feature of Python, in that you are
> allowed to nnest parameter definitions:
>
> >>> def x ((p0, p1), p2):
>
> ... return p0,p1,p2
> ...>>> x(('Does', 'this'), 'work')
>
> ('Does', 'this', 'work')
Reminds
Clement wrote:
> Can any body tell how Dict is implemented in python... plz tell what
> datastructure that uses
>
I think it uses a dict.
James
--
http://mail.python.org/mailman/listinfo/python-list
Is it true that all the above-listed "tutorials" offer undergraduate credit
at Islam University?
--
http://mail.python.org/mailman/listinfo/python-list
John Machin wrote:
> Evidently not; here's some documentation we both need(ed) to read:
>
> http://docs.python.org/tut/node16.html
> """
> Almost all machines today (November 2000) use IEEE-754 floating point
> arithmetic, and almost all platforms map Python floats to IEEE-754
> "double precision
On Feb 24, 12:25 am, Toby A Inkster <[EMAIL PROTECTED]>
wrote:
> aleaxit wrote:
> > If anybody who has easy access to Microsoft's MSVC++.NET (and is willing
> > to try building GMP 4.2 with/for it), or a PPC Mac with XCode installed
> > (possibly with MacOSX 10.3...)
>
> I'm writing this message on
On Feb 25, 1:00 pm, "Paddy" <[EMAIL PROTECTED]> wrote:
> I blogged on finding a new-to-me feature of Python, in that you are
> allowed to nnest parameter definitions:
>
> >>> def x ((p0, p1), p2):
>
> ... return p0,p1,p2
> ...>>> x(('Does', 'this'), 'work')
>
> ('Does', 'this', 'work')
>
>
>
>
Toby wrote:
> Charles D Hixson wrote:
>
>> a class whose sub-classes automatically have unique class variables of
>> a determined form such that I can do a hierarchical search through them
>>
>
> Something like this?
> (scroll down to see the results)
>
>
> # --- begin ---
>
> class AttrS
John Machin wrote:
> On Feb 25, 7:21 pm, Christian Sonne <[EMAIL PROTECTED]> wrote:
>> Long story short, I'm trying to find all ISBN-10 numbers in a multiline
>> string (approximately 10 pages of a normal book), and as far as I can
>> tell, the *correct* thing to match would be this:
>> ".*\D*(\d{1
Niclas schrieb:
> I'm having trouble to work with the special charcters in swedish (Å Ä Ö
> å ä ö). The script is parsing and extracting information from a webpage.
> This works fine and I get all the data correctly. The information is
> then added to a rss file (using xml.dom.minidom.Document() to
On 2007-02-25, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> Item is ALREADY the "current" tuple...
>
> for tpl in mainlist:
> if tpl[0] == "eco" and tpl[1] == "con":
> ec.Append(tpl[2:]) #presuming ec is NOT a list, as Append()
>
I blogged on finding a new-to-me feature of Python, in that you are
allowed to nnest parameter definitions:
>>> def x ((p0, p1), p2):
... return p0,p1,p2
...
>>> x(('Does', 'this'), 'work')
('Does', 'this', 'work')
>>>
Ruben commented that there was a poll on this features continued
existence
Can any body tell how Dict is implemented in python... plz tell what
datastructure that uses
--
http://mail.python.org/mailman/listinfo/python-list
Paddy kirjoitti:
> On Feb 25, 2:01 am, [EMAIL PROTECTED] wrote:
>> While working with lists of tuples is probably very common, none of my
>> five Python books or a Google search tell me how to refer to specific items
>> in each tuple. I find references to sorting a list of tuples, but not
>> extr
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> I have a list and I want to find the first element that meets a
> condition. I do not want to use 'filter', because I want to come out
> of the iteration as soon as the first element is found.
> I have implemented it this way, may be, there should b
On Feb 25, 2:01 am, [EMAIL PROTECTED] wrote:
> While working with lists of tuples is probably very common, none of my
> five Python books or a Google search tell me how to refer to specific items
> in each tuple. I find references to sorting a list of tuples, but not
> extracting tuples based on
John Nagle <[EMAIL PROTECTED]> wrote:
> Are weak refs slower than strong refs? I've been considering
> making the "parent" links in BeautifulSoup into weak refs, so the
> trees will release immediately when they're no longer needed. In
> general, all links back towards the root of a tree should
[EMAIL PROTECTED] writes:
> >> I believe this can only be set globally:
> >>
> >> import socket
> >> socket.setdefaulttimeout(seconds)
>
> Stefan> Uuuh this is no solution for me, because the website-checking
> Stefan> tool is part of a very very big application running i
On Feb 25, 3:59 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
> On 25 Feb 2007 06:11:02 -0800, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>
> > Moreover the reason I got interested in this is because I am creating
> > a Dec class (decimal numbers)
>
> Are you familiar with Python's Decimal
> librar
On Feb 24, 10:17 pm, John Nagle <[EMAIL PROTECTED]> wrote:
>Are weak refs slower than strong refs? I've been considering making the
> "parent" links in BeautifulSoup into weak refs, so the trees will release
> immediately when they're no longer needed. In general, all links back
> towards the
On 25 Feb 2007 06:11:02 -0800, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> Moreover the reason I got interested in this is because I am creating
> a Dec class (decimal numbers)
Are you familiar with Python's Decimal library?
http://docs.python.org/lib/module-decimal.html
--
Jerry
--
http://ma
Niclas schrieb:
> Hi
>
> I'm having trouble to work with the special charcters in swedish (Å Ä Ö
> å ä ö). The script is parsing and extracting information from a webpage.
> This works fine and I get all the data correctly. The information is
> then added to a rss file (using xml.dom.minidom.Do
On Sat, 24 Feb 2007 17:27:12 +, Toby wrote:
> Dan Sommers wrote:
>> You could try the struct module. If your input comes in fixed sized
>> chunks, just call struct.unpack and struct.pack once per chunk.
>
> Thanks, but it was a bit awkward to use for big chunks.
def swapper( bytestring ):
Hi
I'm having trouble to work with the special charcters in swedish (Å Ä Ö
å ä ö). The script is parsing and extracting information from a webpage.
This works fine and I get all the data correctly. The information is
then added to a rss file (using xml.dom.minidom.Document() to create the
file
On Feb 25, 1:31 pm, "John Machin" <[EMAIL PROTECTED]> wrote:
> On Feb 25, 11:06 pm, "Arnaud Delobelle" <[EMAIL PROTECTED]>
> wrote:
[...]
> Evidently not; here's some documentation we both need(ed) to read:
>
> http://docs.python.org/tut/node16.html
Thanks for this link
> I'm very curious to know
On Feb 25, 11:06 pm, "Arnaud Delobelle" <[EMAIL PROTECTED]>
wrote:
> On Feb 25, 11:20 am, "John Machin" <[EMAIL PROTECTED]> wrote:
> [...]
>
> > I'm a little puzzled:
>
> > You don't seem to want a function that will tell you the actual number
> > of significant decimal digits in a particular numbe
John Machin wrote:
> One can even use ElementTree, if the HTML is well-formed. See below.
> However if it is as ill-formed as the sample (4th "td" element not
> closed; I've omitted it below), then the OP would be better off
> sticking with Beautiful Soup :-)
Or (as we were talking about the best
David> Is there a csvlib out there somewhere?
...
David> ...Believe it or not I'm _still_ using python 1.5.7
You might see if someone has written a pure Python version of the csv module
for use in PyPy.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Charles D Hixson wrote:
> a class whose sub-classes automatically have unique class variables of
> a determined form such that I can do a hierarchical search through them
Something like this?
(scroll down to see the results)
# --- begin ---
class AttrSearch(object):
@classmethod
def getcl
Jeff> My post was entitled "Python 3.0 unfit for serious work", you just
Jeff> indicated that the Linux distros will agree with me, in order to
Jeff> be taken seriously, the distros will have to include 2.x python
Jeff> for a very long time. If 3.0 and 2.x have any serious degree
On Feb 25, 11:20 am, "John Machin" <[EMAIL PROTECTED]> wrote:
[...]
> I'm a little puzzled:
>
> You don't seem to want a function that will tell you the actual number
> of significant decimal digits in a particular number e.g.
>
> nsig(12300.0) -> 3
> nsig(0.00123400) -> 4
> etc
>
> You appear to b
>> I believe this can only be set globally:
>>
>> import socket
>> socket.setdefaulttimeout(seconds)
Stefan> Uuuh this is no solution for me, because the website-checking
Stefan> tool is part of a very very big application running in an
Stefan> application server, so g
On Feb 25, 9:57 pm, "Arnaud Delobelle" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I want to know the precision (number of significant digits) of a float
> in a platform-independent manner. I have scoured through the docs but
> I can't find anything about it!
>
> At the moment I use this terrible sub
Jonathan> Some languages, such as Scheme, permit you to make a
Jonathan> transcript of an interactive console session. Is there a way
Jonathan> to do that in Python?
If you decide not to use IPython for some reason, you should be able to
easily whip something up based on the command h
Hi all,
I want to know the precision (number of significant digits) of a float
in a platform-independent manner. I have scoured through the docs but
I can't find anything about it!
At the moment I use this terrible substitute:
FLOAT_PREC = repr(1.0/3).count('3')
How can I do this properly or w
On Feb 25, 7:21 pm, Christian Sonne <[EMAIL PROTECTED]> wrote:
> Long story short, I'm trying to find all ISBN-10 numbers in a multiline
> string (approximately 10 pages of a normal book), and as far as I can
> tell, the *correct* thing to match would be this:
> ".*\D*(\d{10}|\d{9}X)\D*.*"
All of
[EMAIL PROTECTED] wrote:
> I have a list and I want to find the first element that meets a
> condition. I do not want to use 'filter', because I want to come out
> of the iteration as soon as the first element is found.
> I have implemented it this way, may be, there should be a built in
> hiding
> I have implemented it this way, may be, there should be a built in
> hiding somewhere in the standard libraries?
the itertools module might have what you're after. something similar
to your example:
>>> import itertools
>>> r = iter(range(100))
>>> n = itertools.dropwhile(lambda x:x<=13, r)
>>
Hi,
I have a list and I want to find the first element that meets a
condition. I do not want to use 'filter', because I want to come out
of the iteration as soon as the first element is found.
I have implemented it this way, may be, there should be a built in
hiding somewhere in the standard librar
In <[EMAIL PROTECTED]>, Christian Sonne wrote:
> Long story short, I'm trying to find all ISBN-10 numbers in a multiline
> string (approximately 10 pages of a normal book), and as far as I can
> tell, the *correct* thing to match would be this:
> ".*\D*(\d{10}|\d{9}X)\D*.*"
>
> (it should be no
En Sun, 25 Feb 2007 06:12:32 -0300, Marco <[EMAIL PROTECTED]> escribió:
> I wanta know why (Py)Qt has its own lib on socket/ sql/ openGL,etc ?
> Is the lib better than standard lib?
See http://www.commandprompt.com/community/pyqt/x3738
In short, because Qt already had them, and some callbacks or
En Sun, 25 Feb 2007 05:21:49 -0300, Christian Sonne <[EMAIL PROTECTED]>
escribió:
> Long story short, I'm trying to find all ISBN-10 numbers in a multiline
> string (approximately 10 pages of a normal book), and as far as I can
> tell, the *correct* thing to match would be this:
> ".*\D*(\d{10}|
In <[EMAIL PROTECTED]>, Marco wrote:
> I wanta know why (Py)Qt has its own lib on socket/ sql/ openGL,etc ?
That's simply because Qt has these libraries. If you are programming in
C++ this has the advantage that the application is platform independent if
you write against the Qt APIs. As Python
Hello everyone,
I wanta know why (Py)Qt has its own lib on socket/ sql/ openGL,etc ?
Is the lib better than standard lib?
Thank you!
--
LinuX Power
--
http://mail.python.org/mailman/listinfo/python-list
Long story short, I'm trying to find all ISBN-10 numbers in a multiline
string (approximately 10 pages of a normal book), and as far as I can
tell, the *correct* thing to match would be this:
".*\D*(\d{10}|\d{9}X)\D*.*"
(it should be noted that I've removed all '-'s in the string, because
they
Eye opener research
http://www.apfn.org/apfn/WTC_STF.htm
--
http://mail.python.org/mailman/listinfo/python-list
96 matches
Mail list logo