Re: sqlite INSERT performance

2012-05-30 Thread Ben Finney
John Nagle writes: > If you have 67 columns in a table, you may be approaching the > problem incorrectly. +1 SQL QotW, on basis of diplomacy. The OP may need to learn about database normalisation https://en.wikipedia.org/wiki/Database_normalization>. -- \“Sane people have an appr

Re: python3 raw strings and \u escapes

2012-05-30 Thread jmfauth
On 30 mai, 08:52, "ru...@yahoo.com" wrote: > In python2, "\u" escapes are processed in raw unicode > strings.  That is, ur'\u3000' is a string of length 1 > consisting of the IDEOGRAPHIC SPACE unicode character. > > In python3, "\u" escapes are not processed in raw strings. > r'\u3000' is a string

Re: sqlite INSERT performance

2012-05-30 Thread John Nagle
On 5/30/2012 6:57 PM, duncan smith wrote: Hello, I have been attempting to speed up some code by using an sqlite database, but I'm not getting the performance gains I expected. SQLite is a "lite" database. It's good for data that's read a lot and not changed much. It's good for small data

Re: Maintaining Multiple Copies of Python (Linux)

2012-05-30 Thread Ben Finney
Nicholas Fitzkee writes: > I took a look at this, and I'm a little confused. You and me both. I think ‘virtualenv’ is solving the wrong problem, but it appears to be the best answer so far to the need you described. > What am I missing? You'll have to get an answer for that from someone who a

Re: Object cleanup

2012-05-30 Thread Ben Finney
Steven D'Aprano writes: > The destructor doesn't get called into the last reference is gone. And it's important to note that the destructor doesn't get called *immediately* that happens; rather, the destructor will be called *some time after* the last reference to the object is gone. In short:

Re: issubclass(C, Mapping) not behaving as expected

2012-05-30 Thread Steven D'Aprano
On Wed, 30 May 2012 00:55:00 -0700, anntzer.lee wrote: > from collections import * > class C(object): > def __iter__(self): pass > def __contains__(self, i): pass > def __len__(self): pass > def __getitem__(self, i): pass > > issubclass(C, Mapping) => False > [issubclass(C, cls) fo

Re: Maintaining Multiple Copies of Python (Linux)

2012-05-30 Thread Nicholas Fitzkee
On Wednesday, May 30, 2012 7:55:33 PM UTC-5, Ben Finney wrote: > The consensus solution for this is ‘virtualenv’ > http://pypi.python.org/pypi/virtualenv>. > > It is so popular as a solution for the kinds of problems you describe > that its functionality will come into core Python, as discussed i

sqlite INSERT performance

2012-05-30 Thread duncan smith
Hello, I have been attempting to speed up some code by using an sqlite database, but I'm not getting the performance gains I expected. The use case: I have text files containing data which may or may not include a header in the first line. Each line (other than the header) is a record,

Re: Object cleanup

2012-05-30 Thread Steven D'Aprano
On Wed, 30 May 2012 16:56:21 +, John Gordon wrote: > In <6e534661-0823-4c42-8f60-3052e43b7...@googlegroups.com> > "psaff...@googlemail.com" writes: > >> How do I force the memory for these soup objects to be freed? > > Have you tried deleting them, using the "del" command? del doesn't actu

Re: Tkinter deadlock on graceful exit

2012-05-30 Thread Terry Reedy
On 5/30/2012 6:19 PM, Matteo Landi wrote: On May/28, Matteo Landi wrote: Hi list, recently I started to work on an application [1] which makes use of the Tkinter module to handle interaction with the user. Simply put, the app is a text widget displaying a file filtered by given criteria, with a

Re: Maintaining Multiple Copies of Python (Linux)

2012-05-30 Thread Ben Finney
nfitz...@gmail.com writes: > For various reasons, I would like to maintain multiple copies of > python on my (Ubuntu 12.04) linux system. This is primarily for > scientific software development; several modules require different > configuration options than are installed on the 'vanilla' python >

Re: Maintaining Multiple Copies of Python (Linux)

2012-05-30 Thread Michael Hrivnak
http://www.virtualenv.org/ You can install multiple versions of the python interpreter in ubuntu without issue. You can use virtualenv to maintain different site packages for whatever purposes you need. Michael On Wed, May 30, 2012 at 4:38 PM, wrote: > Hi all, > > For various reasons, I would

Re: Tkinter deadlock on graceful exit

2012-05-30 Thread Matteo Landi
On May/28, Matteo Landi wrote: > Hi list, > recently I started to work on an application [1] which makes use of the > Tkinter > module to handle interaction with the user. Simply put, the app is a text > widget displaying a file filtered by given criteria, with a handy feature that > the window i

Re: Proposal about naming conventions around packaging

2012-05-30 Thread Tarek Ziadé
On 5/30/12 6:59 PM, Benoît Bryon wrote: Hi, Hi Benoit you should post this to the distutils SIG Thank you Here is a proposal about naming conventions around packaging. Main question is: would you accept it as a PEP? Preliminary notes (not p

Maintaining Multiple Copies of Python (Linux)

2012-05-30 Thread nfitzkee
Hi all, For various reasons, I would like to maintain multiple copies of python on my (Ubuntu 12.04) linux system. This is primarily for scientific software development; several modules require different configuration options than are installed on the 'vanilla' python included in the Ubuntu di

Proposal about naming conventions around packaging

2012-05-30 Thread Benoît Bryon
Hi, Here is a proposal about naming conventions around packaging. Main question is: would you accept it as a PEP? Preliminary notes (not part of the proposal) Before I start, here are some preliminary no

Re: installing modules in Enthought Python

2012-05-30 Thread Chuck
On May 30, 10:57 am, David Fanning wrote: > Chuck writes: > > > I just downloaded Enthought Python, free version.  I wanted all the > > included packages, but I can't seem to find the correct directory to > > install new Python modules.  Does anybody have an idea?  I am trying > > to add Universal

Re: installing modules in Enthought Python

2012-05-30 Thread Robert Kern
On 5/30/12 4:05 PM, Chuck wrote: I just downloaded Enthought Python, free version. I wanted all the included packages, but I can't seem to find the correct directory to install new Python modules. Does anybody have an idea? I am trying to add Universal Feed Parser to Enthought. I have tried C

Re: python3 raw strings and \u escapes

2012-05-30 Thread jmfauth
On 30 mai, 13:54, Thomas Rachel wrote: > Am 30.05.2012 08:52 schrieb ru...@yahoo.com: > > > > > This breaks a lot of my code because in python 2 > >        re.split (ur'[\u3000]', u'A\u3000A') ==>  [u'A', u'A'] > > but in python 3 (the result of running 2to3), > >        re.split (r'[\u3000]', 'A\

Re: python3 raw strings and \u escapes

2012-05-30 Thread ru...@yahoo.com
On 05/30/2012 10:46 AM, Terry Reedy wrote: > On 5/30/2012 2:52 AM, ru...@yahoo.com wrote: >> In python2, "\u" escapes are processed in raw unicode >> strings. That is, ur'\u3000' is a string of length 1 >> consisting of the IDEOGRAPHIC SPACE unicode character. > > That surprised me until I rechec

Re: Object cleanup

2012-05-30 Thread John Gordon
In <6e534661-0823-4c42-8f60-3052e43b7...@googlegroups.com> "psaff...@googlemail.com" writes: > How do I force the memory for these soup objects to be freed? Have you tried deleting them, using the "del" command? -- John Gordon A is for Amy, who fell down the stairs gor...@pa

Re: python3 raw strings and \u escapes

2012-05-30 Thread Serhiy Storchaka
On 30.05.12 14:54, Thomas Rachel wrote: There is a 3rd one: use r'[ ' + '\u3000' + ']'. Not very nice to read, but should do the trick... Or r'[ %s]' % ('\u3000',). -- http://mail.python.org/mailman/listinfo/python-list

Re: Object cleanup

2012-05-30 Thread Chris Rebert
On Wed, May 30, 2012 at 9:40 AM, Steven D'Aprano wrote: > On Wed, 30 May 2012 09:01:20 -0700, psaff...@googlemail.com wrote: > >> However, I've found that using guppy, after the methods have returned >> most of the memory is being taken up with BeautifulSoup objects of one >> type or another. I'm

Re: installing modules in Enthought Python

2012-05-30 Thread Terry Reedy
On 5/30/2012 11:05 AM, Chuck wrote: I just downloaded Enthought Python, free version. I wanted all the included packages, but I can't seem to find the correct directory to install new Python modules. Does anybody have an idea? I am trying to add Universal Feed Parser to Enthought. I have trie

Re: Adding to Python Decorator Library at wiki.python.org

2012-05-30 Thread Steven D'Aprano
On Wed, 30 May 2012 07:51:32 -0700, marctbg wrote: > I just created an account to contribute to the wiki.python.org Python > Decorator Library Wiki. I added my code titled == Memoize Objects == > using the Wiki editor. The preview looked good. Then i submitted it. > However, it is not showing

Re: python3 raw strings and \u escapes

2012-05-30 Thread Terry Reedy
On 5/30/2012 2:52 AM, ru...@yahoo.com wrote: In python2, "\u" escapes are processed in raw unicode strings. That is, ur'\u3000' is a string of length 1 consisting of the IDEOGRAPHIC SPACE unicode character. That surprised me until I rechecked the fine manual and found: "When an 'r' or 'R' pre

Re: Object cleanup

2012-05-30 Thread Steven D'Aprano
On Wed, 30 May 2012 09:01:20 -0700, psaff...@googlemail.com wrote: > However, I've found that using guppy, after the methods have returned > most of the memory is being taken up with BeautifulSoup objects of one > type or another. I'm not declaring BeautifulSoup objects anywhere else. What's gupp

Object cleanup

2012-05-30 Thread psaff...@googlemail.com
I am writing a screen scraping application using BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/ (which is fantastic, by the way). I have an object that has two methods, each of which loads an HTML document and scrapes out some information, putting strings from the HTML documents i

Re: installing modules in Enthought Python

2012-05-30 Thread David Fanning
Chuck writes: > > I just downloaded Enthought Python, free version. I wanted all the > included packages, but I can't seem to find the correct directory to > install new Python modules. Does anybody have an idea? I am trying > to add Universal Feed Parser to Enthought. I have tried C:\Python

Re: python3 raw strings and \u escapes

2012-05-30 Thread ru...@yahoo.com
On 05/30/2012 05:54 AM, Thomas Rachel wrote: > Am 30.05.2012 08:52 schrieb ru...@yahoo.com: > >> This breaks a lot of my code because in python 2 >>re.split (ur'[\u3000]', u'A\u3000A') ==> [u'A', u'A'] >> but in python 3 (the result of running 2to3), >>re.split (r'[\u3000]', 'A\u30

installing modules in Enthought Python

2012-05-30 Thread Chuck
I just downloaded Enthought Python, free version. I wanted all the included packages, but I can't seem to find the correct directory to install new Python modules. Does anybody have an idea? I am trying to add Universal Feed Parser to Enthought. I have tried C:\Python27, C:\Python27\Lib, C:\Pyt

Adding to Python Decorator Library at wiki.python.org

2012-05-30 Thread marctbg
I just created an account to contribute to the wiki.python.org Python Decorator Library Wiki. I added my code titled == Memoize Objects == using the Wiki editor. The preview looked good. Then i submitted it. However, it is not showing up on the Wiki. I could not find contact info for the maint

Re: python3 raw strings and \u escapes

2012-05-30 Thread Arnaud Delobelle
On 30 May 2012 12:54, Thomas Rachel wrote: > There is a 3rd one: use   r'[ ' + '\u3000' + ']'. Not very nice to read, but > should do the trick... You could even take advantage of string literal concatenation:) r'[' '\u3000' r']' -- Arnaud -- http://mail.python.org/mailman/listinfo/python

Re: python3 raw strings and \u escapes

2012-05-30 Thread Devin Jeanpierre
On Wed, May 30, 2012 at 2:52 AM, ru...@yahoo.com wrote: > Was there a reason for dropping the lexical processing of > \u escapes in strings in python3 (other than to add another > annoyance in a long list of python3 annoyances?) > > And is there no choice for me but to choose between the two > poo

Re: python3 raw strings and \u escapes

2012-05-30 Thread Thomas Rachel
Am 30.05.2012 08:52 schrieb ru...@yahoo.com: This breaks a lot of my code because in python 2 re.split (ur'[\u3000]', u'A\u3000A') ==> [u'A', u'A'] but in python 3 (the result of running 2to3), re.split (r'[\u3000]', 'A\u3000A' ) ==> ['A\u3000A'] I can remove the "r" prefix from

ctypes callback with char array

2012-05-30 Thread ohlfsen
Hello. Hoping that someone can shed some light on a tiny challenge of mine. Through ctypes I'm calling a c DLL which requires me to implement a callback in Python/ctypes. The signature of the callback is something like void foo(int NoOfElements, char Elements[][100]) How do I possible impleme

Re: PIL threading problems

2012-05-30 Thread Christian Heimes
Am 30.05.2012 05:09, schrieb Paul Rubin: > Kind of a long shot, but are there known problems in calling PIL from > multiple threads? I'm getting weird intermittent core dumps from my > app, no idea what's causing them, but PIL is the only C module I'm > using, and I do see some mention on the inte

Re: issubclass(C, Mapping) not behaving as expected

2012-05-30 Thread Peter Otten
anntzer@gmail.com wrote: > from collections import * > class C(object): > def __iter__(self): pass > def __contains__(self, i): pass > def __len__(self): pass > def __getitem__(self, i): pass > issubclass(C, Mapping) => False > [issubclass(C, cls) for cls in Mapping.__mro__] =>

issubclass(C, Mapping) not behaving as expected

2012-05-30 Thread anntzer . lee
from collections import * class C(object): def __iter__(self): pass def __contains__(self, i): pass def __len__(self): pass def __getitem__(self, i): pass issubclass(C, Mapping) => False [issubclass(C, cls) for cls in Mapping.__mro__] => [False, True, True, True, True] i.e. C does

Re: pygame: transparency question

2012-05-30 Thread Ian Kelly
On Tue, May 29, 2012 at 9:33 AM, Scott Siegler wrote: > Hello, > > I have a surface that I load an image onto.  During a collision I would like > to clear out the images of both surfaces that collided and show the score.   > Is there a function call to clear a surface with an image? > > One way I

Re: python3 raw strings and \u escapes

2012-05-30 Thread Andrew Berg
On 5/30/2012 1:52 AM, ru...@yahoo.com wrote: > Was there a reason for dropping the lexical processing of > \u escapes in strings in python3 (other than to add another > annoyance in a long list of python3 annoyances?) To me, this would be a Python 2 annoyance since I would expect r'\u3000' to be li

python3 raw strings and \u escapes

2012-05-30 Thread ru...@yahoo.com
In python2, "\u" escapes are processed in raw unicode strings. That is, ur'\u3000' is a string of length 1 consisting of the IDEOGRAPHIC SPACE unicode character. In python3, "\u" escapes are not processed in raw strings. r'\u3000' is a string of length 6 consisting of a backslash, 'u', '3' and th