Re: Python DXF import library?

2010-04-20 Thread Justin Ezequiel
On Apr 20, 9:19 pm, Stodge wrote: > Is anyone aware of a Python DXF import library? I think I remember > seeing converters but so far I haven't found a library. I need to > write a tool that reads DXFs so I'm not yet sure if a converter would > be of any use. Thanks http://lmgtfy.com/?q=Python+DX

Re: python glibc crypt() function

2010-04-20 Thread luca72
On 20 Apr, 19:38, Peter Otten <__pete...@web.de> wrote: > luca72 wrote: > > Hello i have to do this : > > glibc crypt() function, using salt $1$abcdefgh$ > > > cryptPw = crypt(plainPw, "$1$abcdefgh$") Thanks The result is correct i obtain the same with ctypes and crypt module, so i think that is be

Re: HOW TO build object graph or get superclasses list for self.__class__ ?

2010-04-20 Thread James Mills
On Wed, Apr 21, 2010 at 3:35 PM, Dmitry Ponyatov wrote: > Hello > > Help please with such problem: > > I need to build program object graph (data structure) with additional > parameters for nodes and edges: > > include nxgraph # data structure module allowes any py objects for > node/edge id > # (

HOW TO build object graph or get superclasses list for self.__class__ ?

2010-04-20 Thread Dmitry Ponyatov
Hello Help please with such problem: I need to build program object graph (data structure) with additional parameters for nodes and edges: include nxgraph # data structure module allowes any py objects for node/edge id # (nxgraph ignores 2+ node/edge adding thus no checking need at node/ edge ad

urllib2 times out accessing SSL URL on OS X

2010-04-20 Thread Martin Aspeli
Hi, I am trying to connect to an HTTPS URL using urllib2.urlopen() (in fact, the Suds SOAP client, which internally uses urlopen) on Mac OS X Snow Leopard, with Python 2.6 built from source. The website has a certificate (for *.domain.com), issued by Go Daddy Secure Certification Authority. It is

Re: Japanese (speaking) developer needed for a bit of regex magic

2010-04-20 Thread Ben Finney
Sebastian writes: > All locales return error messages in English. Only the Japanese uses > Japanese which my regular expressions cannot handle at the moment. What exactly are you expecting to happen, and what exactly happens instead? General advice with character sets in Python apply: always ex

Re: dict.keys() and dict.values() are always the same order, is it?

2010-04-20 Thread alex23
Steven D'Aprano wrote: > if you don't trust the language to behave > correctly in this case: > > pairs = zip(d.values(), d.items()) > > what makes you think you can trust d.iteritems(), list comprehensions, or > even tuple packing and unpacking? Because .iteritems() is an atomic operation while t

Re: dict.keys() and dict.values() are always the same order, is it?

2010-04-20 Thread John Yeung
alex23 wrote: > > > > I stand corrected. Thanks Cameron. Cameron Simpson wrote: > > > Oh, I was all ready to say what you said, but decided > > > to check the docs myself first:-) John Yeung wrote: > > I am not too comfortable relying on it.  It feels > > fragile and "implementationy" to me, as I

MAKE A SHITLOAD OF MONEY!!!

2010-04-20 Thread Krushbrook
A little while back, I was browsing these newsgroups, just like you are now, and came across an article similar to this that said you could make thousands of dollars within weeks with only an initial investment of $5.00 ! So I thought, "Yeah, right, this must be a scam", like most of us, b

Re: python glibc crypt() function

2010-04-20 Thread geremy condra
2010/4/20 Дамјан Георгиевски : >>> Hello i have to do this : >>> glibc crypt() function, using salt $1$abcdefgh$ >>> >>> cryptPw = crypt(plainPw, "$1$abcdefgh$") >>> >>> I can do it in python, with package i need? >>> Thanks >> > import ctypes > lib = ctypes.CDLL("libcrypt.so.1") > cryp

Re: Building a GUI Toolkit

2010-04-20 Thread Дамјан Георгиевски
> Rather than writing a windowing toolkit from the low-level, I would > rather like to see some wrapper for existing windowing toolkit which > uses more pythonic idioms. Isn't PyGUI exactly that? http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ -- дамјан ((( http://damjan.softver.org.mk/

Re: python glibc crypt() function

2010-04-20 Thread Дамјан Георгиевски
>> Hello i have to do this : >> glibc crypt() function, using salt $1$abcdefgh$ >> >> cryptPw = crypt(plainPw, "$1$abcdefgh$") >> >> I can do it in python, with package i need? >> Thanks > import ctypes lib = ctypes.CDLL("libcrypt.so.1") crypt = lib.crypt crypt.restype = ctyp

Re: Carol Newman -- SPAM

2010-04-20 Thread Paul Rubin
[url snipped - forwards to viagra spam] -- Zachary Burns [phone number snipped] A Joe job? Poster had looked vaguely legitimate. -- http://mail.python.org/mailman/listinfo/python-list

Re: python wia and RegisterEvent

2010-04-20 Thread News123
Hi Roger, Roger Upole wrote: > gelonida wrote: > ... >> while True: >> print "sleep" >> time.sleep(10) >> >> When I plug / unplug a USB WIA device nothing shows up. >> My C# implementation prints messages on wiaEventDeviceConnected / >> wiaEventDeviceDisconnected events if I register them.

Re: Building a GUI Toolkit

2010-04-20 Thread Martin P. Hellwig
On 04/20/10 21:15, Martin P. Hellwig wrote: On 04/20/10 19:53, Lie Ryan wrote: Rather than writing a windowing toolkit from the low-level, I would rather like to see some wrapper for existing windowing toolkit which uses more pythonic idioms. Most popular python GUI toolkit currently in use a

Re: Code redundancy

2010-04-20 Thread Alan Harris-Reid
Ethan Furman wrote: Alan Harris-Reid wrote: The code is not usually in class.__init__ (otherwise I would have used the self. prefix), but I like your self.__dict__.update(...) solution and I'll try and remember it. The code I was thinking of goes something like as follows (don't have a speci

Re: Code redundancy

2010-04-20 Thread Alan Harris-Reid
Chris Rebert wrote: On Tue, Apr 20, 2010 at 2:59 PM, Alan Harris-Reid wrote: Stefan Behnel wrote: Alan Harris-Reid, 20.04.2010 15:43: During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = 1 class1.attr2 = 2 class1.attr3 = 3 clas

Re: Code redundancy

2010-04-20 Thread Alan Harris-Reid
Xavier Ho wrote: On Wed, Apr 21, 2010 at 7:59 AM, Alan Harris-Reid mailto:aharrisr...@googlemail.com>> wrote: The code is not usually in class.__init__ (otherwise I would have used the self. prefix) Alan, if your variables are not usually in __init__, what's preventing you from using

Re: [PyQt] Carol Newman

2010-04-20 Thread Zac Burns
Yes, please do not remove me. Sorry for the inconvenience! -- Zachary Burns (407)590-4814 Aim - Zac256FL Production Engineer Zindagi Games On Tue, Apr 20, 2010 at 3:36 PM, Chris Kaynor wrote: > There was a G-mail invasion earlier today that allowed e-mails to be sent > from any g-mail account wi

Re: Code redundancy

2010-04-20 Thread Ethan Furman
Alan Harris-Reid wrote: The code is not usually in class.__init__ (otherwise I would have used the self. prefix), but I like your self.__dict__.update(...) solution and I'll try and remember it. The code I was thinking of goes something like as follows (don't have a specific example to hand,

Re: [PyQt] Carol Newman

2010-04-20 Thread Chris Kaynor
There was a G-mail invasion earlier today that allowed e-mails to be sent from any g-mail account without the owner's permission. Chris On Tue, Apr 20, 2010 at 3:06 PM, Nick Gaens wrote: > Please someone remove this address from the lists, because of spamming.. > > > -- > Nick Gaens > > -- > h

Re: Re: Code redundancy

2010-04-20 Thread Chris Rebert
On Tue, Apr 20, 2010 at 2:59 PM, Alan Harris-Reid wrote: > Stefan Behnel wrote: >> Alan Harris-Reid, 20.04.2010 15:43: >>> During my Python (3.1) programming I often find myself having to repeat >>> code such as... >>> >>> class1.attr1 = 1 >>> class1.attr2 = 2 >>> class1.attr3 = 3 >>> class1.attr4

Re: deleting objects present in a list

2010-04-20 Thread Chris Rebert
> On Apr 20, 8:44 pm, Terry Reedy wrote: >> On 4/20/2010 3:21 PM, Sandy wrote: >> > Hi all, >> > I have large number of objects created and to handle them properly, I >> > store them in a list. How can I delete all of these objects (delete I >> > mean here is to remove the object from memory not j

Re: [PyQt] Carol Newman

2010-04-20 Thread Nick Gaens
Please someone remove this address from the lists, because of spamming.. On Tue, Apr 20, 2010 at 11:13 PM, Zac Burns wrote: > http://www.ristorantealpirata.com/home.php > > -- > Zachary Burns > (407)590-4814 > Aim - Zac256FL > Production Engineer > Zindagi Games > ___

Re: gnu readline licensing?

2010-04-20 Thread Irmen de Jong
On 20-4-2010 20:09, Brendan Miller wrote: Python provides a GNU readline interface... since readline is a GPLv3 library, doesn't that make python subject to the GPL? I'm confused because I thought python had a more BSD style license. Also, I presume programs written with the readline interface w

Re: deleting objects present in a list

2010-04-20 Thread Sandy
Thanks for the replies. Terry, What does 'immediately' mean? I did a small test and here are the results. import psutil def testing(): class Object(): pass l = {} apm = psutil.avail_phymem()/(1024*1024) print 'Before creating objs: ' + repr(apm) for i in xrange(5000

Re: Re: Code redundancy

2010-04-20 Thread Xavier Ho
On Wed, Apr 21, 2010 at 7:59 AM, Alan Harris-Reid < aharrisr...@googlemail.com> wrote: > The code is not usually in class.__init__ (otherwise I would have used the > self. prefix) Alan, if your variables are not usually in __init__, what's preventing you from using class variables like this: >>

Re: Re: Code redundancy

2010-04-20 Thread Alan Harris-Reid
Stefan Behnel wrote: Alan Harris-Reid, 20.04.2010 15:43: During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = 1 class1.attr2 = 2 class1.attr3 = 3 class1.attr4 = 4 etc. Is there any way to achieve the same result without having to repeat the cla

Re: Re: Code redundancy

2010-04-20 Thread Alan Harris-Reid
Iain King wrote: On Apr 20, 2:43 pm, Alan Harris-Reid wrote: Hi, During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = class1.attr2 = class1.attr3 = class1.attr4 = etc. Is there any way to achieve the same result without having to repeat th

Re: Re: Code redundancy

2010-04-20 Thread Alan Harris-Reid
Peter Otten wrote: Alan Harris-Reid wrote: Hi, During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = 1 class1.attr2 = 2 class1.attr3 = 3 class1.attr4 = 4 etc. Is there any way to achieve the same result without having to repeat the class1 p

Re: Code redundancy

2010-04-20 Thread Alan Harris-Reid
Jean-Michel Pichavant wrote: Alan Harris-Reid wrote: Hi, During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = 1 class1.attr2 = 2 class1.attr3 = 3 class1.attr4 = 4 etc. Is there any way to achieve the same result without having to repeat the

Carol Newman

2010-04-20 Thread Zac Burns
http://www.ristorantealpirata.com/home.php -- Zachary Burns (407)590-4814 Aim - Zac256FL Production Engineer Zindagi Games -- http://mail.python.org/mailman/listinfo/python-list

Re: gnu readline licensing?

2010-04-20 Thread Robert Kern
On 4/20/10 3:49 PM, Brendan Miller wrote: On Tue, Apr 20, 2010 at 11:38 AM, Robert Kern wrote: On 4/20/10 1:09 PM, Brendan Miller wrote: Python provides a GNU readline interface... since readline is a GPLv3 library, doesn't that make python subject to the GPL? I'm confused because I thought p

Re: Write web apps in Python?

2010-04-20 Thread Bryan
Bruno wrote: > Bryan a écrit : > > I think you guys got some incorrect info about PHP. A variety of > > execution options are available, such as FastCGI and in-server > > modules. > > mod_php, yes, but that doesn't change anything to the fact that it has > to rebuild the whole world on each and eve

Re: gnu readline licensing?

2010-04-20 Thread Brendan Miller
On Tue, Apr 20, 2010 at 11:38 AM, Robert Kern wrote: > On 4/20/10 1:09 PM, Brendan Miller wrote: >> >> Python provides a GNU readline interface... since readline is a GPLv3 >> library, doesn't that make python subject to the GPL? I'm confused >> because I thought python had a more BSD style licens

Re: Building a GUI Toolkit

2010-04-20 Thread Martin P. Hellwig
On 04/20/10 19:53, Lie Ryan wrote: Rather than writing a windowing toolkit from the low-level, I would rather like to see some wrapper for existing windowing toolkit which uses more pythonic idioms. Most popular python GUI toolkit currently in use are only a simple thin wrapper over the librar

Re: python glibc crypt() function

2010-04-20 Thread Peter Otten
geremy condra wrote: > On Tue, Apr 20, 2010 at 1:38 PM, Peter Otten <__pete...@web.de> wrote: >> luca72 wrote: >> >>> Hello i have to do this : >>> glibc crypt() function, using salt $1$abcdefgh$ >>> >>> cryptPw = crypt(plainPw, "$1$abcdefgh$") >>> >>> I can do it in python, with package i need? >

Re: deleting objects present in a list

2010-04-20 Thread Terry Reedy
On 4/20/2010 3:21 PM, Sandy wrote: Hi all, I have large number of objects created and to handle them properly, I store them in a list. How can I delete all of these objects (delete I mean here is to remove the object from memory not just from list)? I cannot use the list to iterate through the ob

Re: deleting objects present in a list

2010-04-20 Thread Chris Rebert
On Tue, Apr 20, 2010 at 12:21 PM, Sandy wrote: > Hi all, > I have large number of objects created and to handle them properly, I > store them in a list. How can I delete all of these objects (delete I > mean here is to remove the object from memory not just from list)? I > cannot use the list to i

deleting objects present in a list

2010-04-20 Thread Sandy
Hi all, I have large number of objects created and to handle them properly, I store them in a list. How can I delete all of these objects (delete I mean here is to remove the object from memory not just from list)? I cannot use the list to iterate through the objects to delete them. Because 'del' o

Re: python glibc crypt() function

2010-04-20 Thread geremy condra
On Tue, Apr 20, 2010 at 1:38 PM, Peter Otten <__pete...@web.de> wrote: > luca72 wrote: > >> Hello i have to do this : >> glibc crypt() function, using salt $1$abcdefgh$ >> >> cryptPw = crypt(plainPw, "$1$abcdefgh$") >> >> I can do it in python, with package i need? >> Thanks > import ctypes >>

Re: Building a GUI Toolkit

2010-04-20 Thread Lie Ryan
On 04/19/10 03:06, Martin P. Hellwig wrote: > On 04/18/10 12:49, Tim Diels wrote: >> Hi >> >> I was thinking of writing a GUI toolkit from scratch using a basic '2D >> library'. I have already come across the Widget Construction Kit. >> >> My main question is: Could I build a GUI toolkit of reasona

"ADVERTISED JOBS IN TEXAS" "jobs in texas" "jobs in texas usa" "jobs in texas houston" "jobs in texas city" "jobs in texas government" "jobs in texas austin" "texas jobs" "texas jobs online" texas j

2010-04-20 Thread saima81
"ADVERTISED JOBS IN TEXAS" "jobs in texas" "jobs in texas usa" "jobs in texas houston" "jobs in texas city" "jobs in texas government" "jobs in texas austin" "texas jobs" "texas jobs online" texas job search" http://jobsintexas-usa.blogspot.com/ "ADVERTISED JOBS IN TEXAS" "jobs in texas" "jobs in

Re: gnu readline licensing?

2010-04-20 Thread Robert Kern
On 4/20/10 1:09 PM, Brendan Miller wrote: Python provides a GNU readline interface... since readline is a GPLv3 library, doesn't that make python subject to the GPL? I'm confused because I thought python had a more BSD style license. The PSF License is more BSD-styled, yes. The readline module

gnu readline licensing?

2010-04-20 Thread Brendan Miller
Python provides a GNU readline interface... since readline is a GPLv3 library, doesn't that make python subject to the GPL? I'm confused because I thought python had a more BSD style license. Also, I presume programs written with the readline interface would still be subject to GPL... might want t

Re: Code redundancy

2010-04-20 Thread Jean-Michel Pichavant
Alan Harris-Reid wrote: Hi, During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = 1 class1.attr2 = 2 class1.attr3 = 3 class1.attr4 = 4 etc. Is there any way to achieve the same result without having to repeat the class1 prefix? Before Python

Re: python glibc crypt() function

2010-04-20 Thread Peter Otten
luca72 wrote: > Hello i have to do this : > glibc crypt() function, using salt $1$abcdefgh$ > > cryptPw = crypt(plainPw, "$1$abcdefgh$") > > I can do it in python, with package i need? > Thanks >>> import ctypes >>> lib = ctypes.CDLL("libcryp

Re: Write web apps in Python?

2010-04-20 Thread Adam Tauno Williams
On Tue, 2010-04-20 at 17:05 +0200, Bruno Desthuilliers wrote: > Adam Tauno Williams a écrit : > > On Mon, 2010-04-19 at 15:15 +0200, Bruno Desthuilliers wrote: > >> Gilles Ganault a écrit : > >>> On Thu, 15 Apr 2010 12:41:56 +0200, Bruno Desthuilliers > >>> wrote: > The PHP execution model (m

Re: Usable street address parser in Python?

2010-04-20 Thread John Nagle
Iain King wrote: Not sure on the volume of addresses you're working with, but as an alternative you could try grabbing the zip code, looking up all addresses in that zip code, and then finding whatever one of those address strings most closely resembles your address string (smallest Levenshtein d

Japanese (speaking) developer needed for a bit of regex magic

2010-04-20 Thread Sebastian
Hi all, I'm working on Python bindings for the Amazon Product Advertising API (http://pypi.python.org/pypi/python-amazon-product-api/) which supports the different localised versions - among them a Japanese one (for http://www.amazon.co.jp). All locales return error messages in English. Only the

Re: Code redundancy

2010-04-20 Thread Peter Otten
Alan Harris-Reid wrote: > Hi, > > During my Python (3.1) programming I often find myself having to repeat > code such as... > > class1.attr1 = 1 > class1.attr2 = 2 > class1.attr3 = 3 > class1.attr4 = 4 > etc. > > Is there any way to achieve the same result without having to repeat the > class1

Re: Write web apps in Python?

2010-04-20 Thread Bruno Desthuilliers
Adam Tauno Williams a écrit : On Mon, 2010-04-19 at 15:15 +0200, Bruno Desthuilliers wrote: Gilles Ganault a écrit : On Thu, 15 Apr 2010 12:41:56 +0200, Bruno Desthuilliers wrote: The PHP execution model (mostly based on CGI FWIW) tends to be a bit unpractical for non-trivial applications sin

Re: Write web apps in Python?

2010-04-20 Thread Bruno Desthuilliers
Bryan a écrit : Bruno Desthuilliers wrote: Gilles Ganault a écrit : Apart from the ease of having the application run at all times, I'd be curious to read about an application that was written in PHP and then a long-running process and see if performance improved. I'm not sure there's a way to

Re: Code redundancy

2010-04-20 Thread Iain King
On Apr 20, 2:43 pm, Alan Harris-Reid wrote: > Hi, > > During my Python (3.1) programming I often find myself having to repeat > code such as... > > class1.attr1 = 1 > class1.attr2 = 2 > class1.attr3 = 3 > class1.attr4 = 4 > etc. > > Is there any way to achieve the same result without having to rep

Re: Code redundancy

2010-04-20 Thread Stefan Behnel
Alan Harris-Reid, 20.04.2010 15:43: During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = 1 class1.attr2 = 2 class1.attr3 = 3 class1.attr4 = 4 etc. Is there any way to achieve the same result without having to repeat the class1 prefix? Before Pyt

Re: python glibc crypt() function

2010-04-20 Thread geremy condra
On Tue, Apr 20, 2010 at 9:54 AM, luca72 wrote: > Hello i have to do this : > glibc crypt() function, using salt $1$abcdefgh$ > > cryptPw = crypt(plainPw, "$1$abcdefgh$") > > I can do it in python, with package i need? > Thanks > -- > http://mail.python.org/mailman/listinfo/python-list > http://do

python glibc crypt() function

2010-04-20 Thread luca72
Hello i have to do this : glibc crypt() function, using salt $1$abcdefgh$ cryptPw = crypt(plainPw, "$1$abcdefgh$") I can do it in python, with package i need? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Usable street address parser in Python?

2010-04-20 Thread Grant Edwards
On 2010-04-20, Tim Roberts wrote: > This is a very tricky problem. Consider Salem, Oregon, which puts the > direction after the street: > > 3340 Astoria Way NE > Salem, OR 97303 In Minneapolis, the direction comes before the street in some quadrants and after it in others. I used to li

Code redundancy

2010-04-20 Thread Alan Harris-Reid
Hi, During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = 1 class1.attr2 = 2 class1.attr3 = 3 class1.attr4 = 4 etc. Is there any way to achieve the same result without having to repeat the class1 prefix? Before Python my previous main languag

Re: Why this exception catch doesn't work?? (python 3)

2010-04-20 Thread MRAB
Andrej Mitrovic wrote: On Apr 20, 1:06 pm, MRAB wrote: Dodo wrote: Hello, I don't understand why this won't execute import urllib.request as u import socket socket.setdefaulttimeout(10) l = "http://img144.imageshack.us/my.php?image=koumakandg8.jpg"; # supposed to timeout try: h = u.urlretr

Re: Why this exception catch doesn't work?? (python 3)

2010-04-20 Thread Andrej Mitrovic
On Apr 20, 1:06 pm, MRAB wrote: > Dodo wrote: > > Hello, > > > I don't understand why this won't execute > > > import urllib.request as u > > import socket > > socket.setdefaulttimeout(10) > > > l = "http://img144.imageshack.us/my.php?image=koumakandg8.jpg"; # > > supposed to timeout > > try: > >

Python DXF import library?

2010-04-20 Thread Stodge
Is anyone aware of a Python DXF import library? I think I remember seeing converters but so far I haven't found a library. I need to write a tool that reads DXFs so I'm not yet sure if a converter would be of any use. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Write web apps in Python?

2010-04-20 Thread Adam Tauno Williams
On Mon, 2010-04-19 at 15:15 +0200, Bruno Desthuilliers wrote: > Gilles Ganault a écrit : > > On Thu, 15 Apr 2010 12:41:56 +0200, Bruno Desthuilliers > > wrote: > >> The PHP execution model (mostly based on CGI FWIW) tends to be a bit > >> unpractical for non-trivial applications since you have to

Re: Why this exception catch doesn't work?? (python 3)

2010-04-20 Thread Dodo
Le 20/04/2010 13:06, MRAB a écrit : Dodo wrote: Hello, I don't understand why this won't execute import urllib.request as u import socket socket.setdefaulttimeout(10) l = "http://img144.imageshack.us/my.php?image=koumakandg8.jpg"; # supposed to timeout try: h = u.urlretrieve(l) except u.URLE

Re: Write web apps in Python?

2010-04-20 Thread Bryan
Bruno Desthuilliers wrote: > Gilles Ganault a écrit : > > Apart from the ease of having the application run at all times, I'd be > > curious to read about an application that was written in PHP and then > > a long-running process and see if performance improved. > > I'm not sure there's a way to do

Re: Why this exception catch doesn't work?? (python 3)

2010-04-20 Thread MRAB
Dodo wrote: Hello, I don't understand why this won't execute import urllib.request as u import socket socket.setdefaulttimeout(10) l = "http://img144.imageshack.us/my.php?image=koumakandg8.jpg"; # supposed to timeout try: h = u.urlretrieve(l) except u.URLError, e: # I tried u.e too, no

Why this exception catch doesn't work?? (python 3)

2010-04-20 Thread Dodo
Hello, I don't understand why this won't execute import urllib.request as u import socket socket.setdefaulttimeout(10) l = "http://img144.imageshack.us/my.php?image=koumakandg8.jpg"; # supposed to timeout try: h = u.urlretrieve(l) except u.URLError, e: # I tried u.e too, no effect.

Re: Usable street address parser in Python?

2010-04-20 Thread Iain King
On Apr 20, 8:24 am, John Yeung wrote: > My response is similar to John Roth's.  It's mainly just sympathy. ;) > > I deal with addresses a lot, and I know that a really good parser is > both rare/expensive to find and difficult to write yourself.  We have > commercial, USPS-certified products where

Re: dict.keys() and dict.values() are always the same order, is it?

2010-04-20 Thread Carl Banks
On Apr 20, 1:13 am, Dave Angel wrote: > Menghan Zheng wrote: > > Hello! > > > Is it assured the following statement is always True? > > If it is always True, in which version, python2.x or python3.x? > > a = dict() > > > ... > > assert(a.values == [a[k] for k in a.keys()]) > > > --> ? >

Re: any modules having a function to partition a list by predicate provided?

2010-04-20 Thread Bryan
knifenomad wrote: > i know it's not very hard to get that solution. > just by implementing simple function like below. > >       def partition(target, predicate): >             """ >             split a list into two partitions with a predicate > provided. >             any better ideas? :) >      

Re: Tkinter scrollbar background color doesn't work

2010-04-20 Thread eb303
On Apr 19, 6:35 pm, KL wrote: > Tkinter scrollbar widget's "background" and "relief" options seem not > work. > > The below is the codes I tried and the python/tk information: > === > > ActivePython 2.6.4.8 (ActiveState Software Inc.) based on > Python 2.6.4 (r264:75706, Nov  3 200

Re: dict.keys() and dict.values() are always the same order, is it?

2010-04-20 Thread Dave Angel
Menghan Zheng wrote: Hello! Is it assured the following statement is always True? If it is always True, in which version, python2.x or python3.x? a = dict() ... assert(a.values == [a[k] for k in a.keys()]) --> ? Menghan Zheng No, it's never true. The assert st

Re: dict.keys() and dict.values() are always the same order, is it?

2010-04-20 Thread Steven D'Aprano
On Mon, 19 Apr 2010 23:47:06 -0700, John Yeung wrote: > On Apr 20, 1:23 am, Cameron Simpson wrote: >> On 19Apr2010 21:31, alex23 wrote: | Cameron Simpson >> wrote: | >   If items(), keys(), values(), >> iteritems(), iterkeys(), and | >   itervalues() are called with no >> intervening modificati

Re: Usable street address parser in Python?

2010-04-20 Thread John Yeung
My response is similar to John Roth's. It's mainly just sympathy. ;) I deal with addresses a lot, and I know that a really good parser is both rare/expensive to find and difficult to write yourself. We have commercial, USPS-certified products where I work, and even with those I've written a good