Re: best way to compare contents of 2 lists?

2009-04-27 Thread ajaksu
On Apr 24, 4:41 pm, norseman wrote: > (How do I) ...explain these? [...] > I can get the sashimi and take it home and BBQ it, I can roast it, I can > steam it, I can wok it,..., but the other is what it is. (greasy) > > Besides, who says I like your cooking?  :) Err... http://mail.python.org/pipe

Re: Supply a plugin interface

2009-04-27 Thread Johannes Bauer
Steven D'Aprano schrieb: >> How do I do that at runtime with Python? > > Untested: [Code] > Hope this is useful. Very, very, very useful. Works like a charm, just like that. Thanks a whole bunch! Kind regards, Johannes -- "Meine Gegenklage gegen dich lautet dann auf bewusste Verlogenheit, ver

Re: Get item from set

2009-04-27 Thread Johannes Bauer
Johannes Bauer schrieb: > Is there something like the "getelement" function? How can I do what I want? One side note: The obvious trivial solution: def findset(s, e): for i in s: if e == i: return i return None is because of its complexity

Re: Get item from set

2009-04-27 Thread Johannes Bauer
Peter Otten schrieb: > class Grab: > def __init__(self, value): > self.search_value = value > def __hash__(self): > return hash(self.search_value) > def __eq__(self, other): > if self.search_value == other: > self.actual_value = other > r

Re: Re: ActiveState Komodo Edit?

2009-04-27 Thread John Doe
Dave Angel wrote: ... > Quickest way to indent multiple lines is to select them, then > press tab. Thanks. Useful because I usually paste blocks of code. Lastly... Is there a way to force the editor to open text (*.txt) files as Python files so that they are color-coded? Without changing the

Re: getting linux distro used...

2009-04-27 Thread James Matthews
You can always pipe the information for the command line. On Mon, Apr 27, 2009 at 8:59 AM, David Lyon wrote: > > perphaps platform.uname()? > > On Sun, 26 Apr 2009 22:35:29 -0700 (PDT), deostroll > wrote: > > Hi, > > > > I just found that you could use platform.system() to get the > > underlying

Re: getting linux distro used...

2009-04-27 Thread Lawrence D'Oliveiro
In message , deostroll wrote: > I just found that you could use platform.system() to get the > underlying os used. But is there a way to get the distro used...? Mostly the differences will not be important. But if you want to know, I have been compiling a list of tests here

Re: mailbox.mbox.add() also seems to set file permissions

2009-04-27 Thread tinnews
Aahz wrote: > In article , > Grant Edwards wrote: > >On 2009-04-25, tinn...@isbd.co.uk wrote: > >> > >> Where should one report bugs/errors in python library classes? > > > >http://docs.python.org/bugs.html > > That's for doc bugs; regular bugs go to bugs.python.org (which is > currently down

Re: getting linux distro used...

2009-04-27 Thread r-w
deostroll wrote: Hi, I just found that you could use platform.system() to get the underlying os used. But is there a way to get the distro used...? --deostroll platform.dist() returns ('debian', 'lenny/sid', '') on my Ubuntu box. Ross -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Lawrence D'Oliveiro
In message , Paul Hemans wrote: > One problem though that I didn't mention in my original > posting was that the replication may only require updating one or more > fields, that is a problem with a generating a single SQL statement to > cover all requests. That's not a big issue. Assume the field

Re: Into itertools

2009-04-27 Thread Arnaud Delobelle
On 26 Apr, 17:32, bearophileh...@lycos.com wrote: > Some idioms are so common that I think they deserve to be written in C > into the itertools module. > > 1) leniter(iterator) [...] > A Python implementation: > > def leniter(iterator): >     if hasattr(iterator, "__len__"): >         return len(it

Re: Into itertools

2009-04-27 Thread bearophileHUGS
Arnaud Delobelle: > Some people would write it as: > > def leniter(iterable): >     if hasattr(iterable, '__len__'): >         return len(iteratble) >     return sum(1 for _ in iterable) That's slower than my version. > > def xpairwise(iterable): > >     return izip(iterable, islice(iterable,

Re: Into itertools

2009-04-27 Thread Mark Dickinson
On Apr 26, 5:32 pm, bearophileh...@lycos.com wrote: > 3) xpairs(seq) >     >>> list(xpairs(range(5))) >     [(0, 1), (0, 2), (0, 3), (0, 4), (1, 2), (1, 3), (1, 4), (2, 3), > (2, 4), (3, 4)] Doesn't itertools.combinations already do this for you? >>> list(itertools.combinations(range(5), 2)) [(

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread Vsevolod
On Apr 27, 3:20 am, a...@pythoncraft.com (Aahz) wrote: > In article > <793a5176-ec2d-4ffd-b1e7-762077733...@v35g2000pro.googlegroups.com>, > > Vsevolod wrote: > >On Apr 26, 6:28 pm, a...@pythoncraft.com (Aahz) wrote: > > >> The problem is that thread-killing (in the literal sense) doesn't work.

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Duncan Booth
Lawrence D'Oliveiro wrote: > In message , Paul Hemans wrote: > >> One problem though that I didn't mention in my original >> posting was that the replication may only require updating one or >> more fields, that is a problem with a generating a single SQL >> statement to cover all requests. > >

Re: getting linux distro used...

2009-04-27 Thread Sebastian Wiesner
> In message a88b-2ded6f8af...@y33g2000prg.googlegroups.com>, deostroll wrote: > >> I just found that you could use platform.system() to get the >> underlying os used. But is there a way to get the distro used...? > > Mostly the differences will not be important. But if you want to know, I > h

Re: ActiveState Komodo Edit?

2009-04-27 Thread Dave Angel
John Doe wrote: Dave Angel wrote: ... Quickest way to indent multiple lines is to select them, then press tab. Thanks. Useful because I usually paste blocks of code. Lastly... Is there a way to force the editor to open text (*.txt) files as Python files so that they are color-cod

Re: getting linux distro used...

2009-04-27 Thread Lawrence D'Oliveiro
In message , Sebastian Wiesner wrote: > > >> . > > At least the Gentoo-Test is not very reliable. It's a wiki. You know what to do. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Lawrence D'Oliveiro
In message , Duncan Booth wrote: > Lawrence D'Oliveiro wrote: > >> In message , Paul Hemans wrote: >> >>> One problem though that I didn't mention in my original >>> posting was that the replication may only require updating one or >>> more fields, that is a problem with a generating a single S

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread Richard Brodie
"Vsevolod" wrote in message news:42cebb2b-0361-416c-8932-9371da50a...@y6g2000prf.googlegroups.com... > There's a common unification library -- bordeaux-threads -- > that abstracts away implementation specifics. It's API includes > the function destroy-thread. Which is deprecated, like the Jav

Re: getting linux distro used...

2009-04-27 Thread Marcin Stępnicki
Dnia Sun, 26 Apr 2009 22:35:29 -0700, deostroll napisał(a): > Hi, > > I just found that you could use platform.system() to get the underlying > os used. But is there a way to get the distro used...? Perhaps reading /etc/issue is sufficient? However, I know that for example Slackware puts its ve

CSV performance

2009-04-27 Thread psaff...@googlemail.com
I'm using the CSV library to process a large amount of data - 28 files, each of 130MB. Just reading in the data from one file and filing it into very simple data structures (numpy arrays and a cstringio) takes around 10 seconds. If I just slurp one file into a string, it only takes about a second,

Re: ActiveState Komodo Edit?

2009-04-27 Thread John Doe
Dave Angel wrote: > John Doe wrote: >> Dave Angel wrote: ... >> Lastly... Is there a way to force the editor to open text (*.txt) >> files as Python files so that they are color-coded? Without >> changing the *.txt extension? I will be editing text files that >> are part of a Python progr

Dynamically fill prepared (PDF?) forms

2009-04-27 Thread pom
Hello I'm looking for a way to fill in forms with data retrieved from a mysql db. But what I'm especially looking for is an easy way to create the layout of the forms itself. Handling data from mysql is not a problem for me. Making static programmed PDF output using Reportlab is not a prob

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread Francesco Guerrieri
On Mon, Apr 27, 2009 at 11:55 AM, Vsevolod wrote: > > As well I'd like to outline, that, IMO, your answer exhibits the > common attitude among pythonistas: everything should be done in one > true way, which is the best option (and that is how it's implemented > in the current version of the langu

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread Vsevolod
On Apr 27, 2:17 pm, "Richard Brodie" wrote: > "Vsevolod" wrote in message > > news:42cebb2b-0361-416c-8932-9371da50a...@y6g2000prf.googlegroups.com... > > > There's a common unification library -- bordeaux-threads -- > > that abstracts away implementation specifics. It's API includes > > the func

Web based application development using python

2009-04-27 Thread Rahul
Hello all, I have two questions 1) When will be python3.1 (final) get released? (The date should be appropriate (proposed), it must be the span in between which there are chances of release) 2) I have my web based application written using mod_python but was needed to know if there is be

is PyCodec_Encode API able to change encoding fron UCS-2 to UCS-4

2009-04-27 Thread rahul
is this generic API can be use to change ucs-2 to ucs-4 PyObject * PyCodec_Encode( PyObject *object, const char *encoding, const char *errors ); if yes than what is the format of denoting ucs-4, because i try to do that but all times i got segmentation fault, i used "

is PyCodec_Encode API able to change encoding fron UCS-2 to UCS-4

2009-04-27 Thread rahul
is this generic API can be use to change ucs-2 to ucs-4 PyObject * PyCodec_Encode( PyObject *object, const char *encoding, const char *errors ); if yes than what is the format of denoting ucs-4, because i try to do that but all times i got segmentation fault, i used "

Re: CSV performance

2009-04-27 Thread John Machin
On Apr 27, 9:22 pm, "psaff...@googlemail.com" wrote: > I'm using the CSV library to process a large amount of data - 28 > files, each of 130MB. Just reading in the data from one file and > filing it into very simple data structures (numpy arrays and a > cstringio) takes around 10 seconds. If I jus

Re: CSV performance

2009-04-27 Thread Peter Otten
psaff...@googlemail.com wrote: > I'm using the CSV library to process a large amount of data - 28 > files, each of 130MB. Just reading in the data from one file and > filing it into very simple data structures (numpy arrays and a > cstringio) takes around 10 seconds. If I just slurp one file into

Re: CSV performance

2009-04-27 Thread Tim Chase
I'm using the CSV library to process a large amount of data - 28 files, each of 130MB. Just reading in the data from one file and filing it into very simple data structures (numpy arrays and a cstringio) takes around 10 seconds. If I just slurp one file into a string, it only takes about a second,

Re: Help AIX 5.3 build on Python-3.1a2

2009-04-27 Thread pruebauno
On Apr 26, 5:14 am, Jeroen Ruigrok van der Werven wrote: > -On [20090425 19:17], Aahz (a...@pythoncraft.com) wrote: > > >In article > >, > > wrote: > >>"Include/token.h", line 42.9: 1506-213 (S) Macro name TILDE cannot be > >>redefined. > >>"Include/token.h", line 42.9: 1506-358 (I) "TILDE" is d

Re: Web based application development using python

2009-04-27 Thread Scott David Daniels
Rahul wrote: Hello all, I have two questions 1) When will be python3.1 (final) get released? (The date should be appropriate (proposed), it must be the span in between which there are chances of release) Go to http://www.puthon.org Click on Core Development Click on PEP Index under Other

Re: CSV performance

2009-04-27 Thread psaff...@googlemail.com
Thanks for your replies. Many apologies for not including the right information first time around. More information is below. I have tried running it just on the csv read: import time import csv afile = "largefile.txt" t0 = time.clock() print "working at file", afile reader = csv.reader(open(a

Re: Lisp mentality vs. Python mentality

2009-04-27 Thread Marco Mariani
Scott David Daniels wrote: I don't remember who, but something famously said, in effect: Debugging is hard, maybe twice as hard as writing the code in the first place. Unless you are one of those nonexistent few He would be the K in K&R. -- http://mail.python.org/mailman/listinfo/pyth

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Mike Kent
On Apr 27, 1:49 am, John Machin wrote: > > I am > > having a look at eval and exec > > WRONG WAY > GO BACK +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: CSV performance

2009-04-27 Thread grocery_stocker
On Apr 27, 5:15 am, Peter Otten <__pete...@web.de> wrote: > psaff...@googlemail.com wrote: > > I'm using the CSV library to process a large amount of data - 28 > > files, each of 130MB. Just reading in the data from one file and > > filing it into very simple data structures (numpy arrays and a > >

Re: Help AIX 5.3 build on Python-3.1a2

2009-04-27 Thread Jeroen Ruigrok van der Werven
-On [20090427 15:00], prueba...@latinmail.com (prueba...@latinmail.com) wrote: >Thanks Jeroen. I know that AIX isn't as supported as other platforms, >but I thought it wouldn't hurt to ask anyway. At least now everybody >can search for that particular problem and find something.

Re: CSV performance

2009-04-27 Thread Peter Otten
grocery_stocker wrote: > On Apr 27, 5:15 am, Peter Otten <__pete...@web.de> wrote: >> psaff...@googlemail.com wrote: >> > I'm using the CSV library to process a large amount of data - 28 >> > files, each of 130MB. Just reading in the data from one file and >> > filing it into very simple data stru

Re: CSV performance

2009-04-27 Thread Tim Chase
I have tried running it just on the csv read: ... print "finished: %f.2" % (t1 - t0) I presume you wanted "%.2f" here. :) $ ./largefilespeedtest.py working at file largefile.txt finished: 3.86.2 So just the CSV processing of the file takes just shy of 4 seconds and you said that just

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Martin P. Hellwig
Carbon Man wrote: I have a program that is generated from a generic process. It's job is to check to see whether records (replicated from another system) exist in a local table, and if it doesn't, to add them. To answer the topic question, it would be limited to the memory your platform can

Re: CSV performance

2009-04-27 Thread Peter Otten
psaff...@googlemail.com wrote: > Thanks for your replies. Many apologies for not including the right > information first time around. More information is below. > > I have tried running it just on the csv read: > $ ./largefilespeedtest.py > working at file largefile.txt > finished: 3.86.2 >

IDE for Win CE?

2009-04-27 Thread Albert-jan Roskam
Hi, A colleague of mine is looking for a Python IDE for Windows CE. Does anybody happen to know what is a good choice? Thanks, AJ -- http://mail.python.org/mailman/listinfo/python-list

Re: Lisp mentality vs. Python mentality

2009-04-27 Thread Paul Rubin
Carl Banks writes: > > > Presumably you have to protect objects to share them?  There you go: > > > anytime you try to acquire a lock have the thread check to see whether > > > to abort. > > > > Normally, acquiring a lock doesn't require running code in other > > threads, at least in the uncontend

Re: Get item from set

2009-04-27 Thread Aahz
In article , Peter Otten <__pete...@web.de> wrote: > >Here's a trick to find the actual element. I think Raymond Hettinger posted >an implementation of this idea recently, but I can't find it at the moment. Your code is inverted from Raymond's: http://code.activestate.com/recipes/499299/ class

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Aahz
In article , Steven D'Aprano wrote: >On Sun, 26 Apr 2009 21:51:00 -0700, John Machin wrote: >> >> ἐδάκρυσεν ὁ Ἰησοῦς > >Alright, I give up. Is that APL code? *grin* base64 encoding -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you thin

Re: Lisp mentality vs. Python mentality

2009-04-27 Thread Zamnedix
On Apr 24, 11:06 pm, Carl Banks wrote: > In answering the recent question by Mark Tarver, I think I finally hit > on why Lisp programmers are the way they are (in particular, why they > are often so hostile to the "There should only be one obvious way to > do it" Zen). > > Say you put this task to

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread Aahz
In article <42cebb2b-0361-416c-8932-9371da50a...@y6g2000prf.googlegroups.com>, Vsevolod wrote: > >As well I'd like to outline, that, IMO, your answer exhibits the >common attitude among pythonistas: everything should be done in one >true way, which is the best option (and that is how it's impleme

getattr on a function

2009-04-27 Thread Mr SZ
Hi all, Is it possible to call functions using getattr. I have written a simple script with functions that call either SSL, TLS or plain functionality. something like: def func(): ... def funcSSL(): ... def funcTLS(): ... Now, based on my args I would like to call either one of them. I

Best way to evaluate boolean expressions from strings?

2009-04-27 Thread Gustavo Narea
Hello, everybody. I need to evaluate boolean expressions like "foo == 1" or "foo ==1 and (bar > 2 or bar == 0)" which are defined as strings (in a database or a plain text file, for example). How would you achieve this? These expressions will contain placeholders for Python objects (like "foo" an

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread Vsevolod
On Apr 27, 7:16 pm, a...@pythoncraft.com (Aahz) wrote: > Did you see my comment about Java? This particular issue has little to > do with Python. I won't disagree that what you're describing is > sometimes a problem in the Python community, but you're picking the > wrong issue to claim its releva

Re: getattr on a function

2009-04-27 Thread Peter Otten
Mr SZ wrote: > Is it possible to call functions using getattr. I have written a simple > script with functions that call either SSL, TLS or plain functionality. > > something like: > def func(): > ... > > def funcSSL(): > ... > > def funcTLS(): > ... > > Now, based on my args I would lik

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread Aahz
In article <22272831-8d11-42d6-a587-9a2ab4712...@p6g2000pre.googlegroups.com>, Vsevolod wrote: > >Yet there was no response to my point, that the original example was >not realistically depicting the Lisp world, while more characteristic >of the Python one. That's because there's no response to

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Wolfgang Rohdewald
On Montag, 27. April 2009, John Machin wrote: > ἐδάκρυσεν ὁ Ἰησοῦς και εγώ +1 -- Wolfgang -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to evaluate boolean expressions from strings?

2009-04-27 Thread Gabriel Genellina
En Mon, 27 Apr 2009 14:03:01 -0300, Gustavo Narea escribió: I need to evaluate boolean expressions like "foo == 1" or "foo ==1 and (bar > 2 or bar == 0)" which are defined as strings (in a database or a plain text file, for example). How would you achieve this? This recent thread may be of

Re: Best way to evaluate boolean expressions from strings?

2009-04-27 Thread Peter Otten
Gustavo Narea wrote: > I need to evaluate boolean expressions like "foo == 1" or "foo ==1 and > (bar > 2 or bar == 0)" which are defined as strings (in a database or > a plain text file, for example). How would you achieve this? > > These expressions will contain placeholders for Python objects (

Re: getattr on a function

2009-04-27 Thread John Machin
On Apr 28, 2:30 am, Mr SZ wrote: > Hi all, > > Is it possible to call functions using getattr. I have written a simple > script with functions that call either SSL, TLS or plain functionality. > > something like: > def func(): >   ... > > def funcSSL(): >   ... > > def funcTLS(): >   ... > > Now,

Re: ActiveState Komodo Edit?

2009-04-27 Thread Trent Mick
John Doe wrote: Another question... There is a region on the left margin to the left of the code and to BTW, we call those regions "gutters" of the editing area. the right of the outlining area, in between the code and the outlining area. It looks like an area used to select lines. But draggi

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Gabriel Genellina
En Mon, 27 Apr 2009 13:12:29 -0300, Aahz escribió: In article , Steven D'Aprano wrote: On Sun, 26 Apr 2009 21:51:00 -0700, John Machin wrote: ἐδάκρυσεν ὁ Ἰησοῦς Alright, I give up. Is that APL code? *grin* base64 encoding Yes, my news client kindly decoded it for me. It looks like Gr

Re: Cannot find text in *.py files with Windows Explorer?

2009-04-27 Thread Terry Reedy
John Doe wrote: John Doe wrote: ... Another file manager, FreeCommander, does find text in Python files. However... It does not have Undo! Potentially risky. Undo is an editor function. I do not believe Windows Explore has Undo either. -- http://mail.python.org/mailman/listinfo/python

Re: and [True,True] --> [True, True]?????

2009-04-27 Thread Terry Reedy
jazbees wrote: On Apr 25, 12:11 pm, Duncan Booth wrote: jazbees wrote: hasvowels = lambda x:max([y in x for y in "aeiou"]) hasvowels("parsnips") True hasvowels("sfwdkj") False Do you object to using def to define functions? Not at all. Do you object to my use of lambdas? I'm not aware

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Gabriel Genellina
En Mon, 27 Apr 2009 14:50:23 -0300, Gabriel Genellina escribió: En Mon, 27 Apr 2009 13:12:29 -0300, Aahz escribió: In article , Steven D'Aprano wrote: On Sun, 26 Apr 2009 21:51:00 -0700, John Machin wrote: ἐδάκρυσεν ὁ Ἰησοῦς Alright, I give up. Is that APL code? *grin* base64 enco

Re: CSV performance

2009-04-27 Thread Scott David Daniels
psaff...@googlemail.com wrote: Thanks for your replies. Many apologies for not including the right information first time around. More information is below Here is another way to try (untested): import numpy import time chrommap = dict(chrY='y', chrX='x', chr13='c', chr12='b', chr11='a',

Re: Help AIX 5.3 build on Python-3.1a2

2009-04-27 Thread pruebauno
On Apr 27, 10:26 am, Jeroen Ruigrok van der Werven wrote: > -On [20090427 15:00], prueba...@latinmail.com (prueba...@latinmail.com) wrote: > > >Thanks Jeroen. I know that AIX isn't as supported as other platforms, > >but I thought it wouldn't hurt to ask anyway. A

Re: Cannot find text in *.py files with Windows Explorer?

2009-04-27 Thread John Doe
Terry Reedy wrote: > John Doe wrote: >> John Doe wrote: >> >> ... >> >>> Another file manager, FreeCommander, does find text in Python >>> files. >> >> However... It does not have Undo! Potentially risky. > > Undo is an editor function. I do not believe Windows Explore has > Undo either. B

Re: ActiveState Komodo Edit?

2009-04-27 Thread John Doe
Trent Mick wrote: > John Doe wrote: >> There is a region on the left margin to the left of the code > BTW, we call those regions "gutters" of the editing area. Okay. >> the right of the outlining area, in between the code and the >> outlining area. It looks like an area used to select lines.

Re: Get item from set

2009-04-27 Thread Terry Reedy
Johannes Bauer wrote: Hi group, I have a very simple about sets. This is a minimal example: #!/usr/bin/python class x(): def __init__(self, y): self.__y = y def __eq__(self, other): return self.__y == other.__y def __hash__(self):

Re: wxpython notebook oddness

2009-04-27 Thread Gabriel Genellina
En Thu, 23 Apr 2009 16:44:25 -0300, Lawson English escribió: Can anyone tell me why these two behave differfently? http://pastebin.com/m57bee079 vs http://pastebin.com/m3c044b29 The code is so different that I don't see why they should behave similarly... Please strip it down to the bar

Re: ActiveState Komodo Edit?

2009-04-27 Thread Trent Mick
If you make line numbers visible (View -> View Line Numbers) then you can do what you want in the line numbers gutter. I am using the free editor-only Komodo Edit. Apparently that does not work here. I believe it was a recent change. What version are you using? You could try the latest night

Re: getattr on a function

2009-04-27 Thread Terry Reedy
Mr SZ wrote: Hi all, Is it possible to call functions using getattr. I have written a simple script with functions that call either SSL, TLS or plain functionality. something like: def func(): ... def funcSSL(): ... def funcTLS(): funcs = {'none':func, 'SSL':funcSSL, 'TLS':funcTLS} ...

Re: wxpython notebook oddness

2009-04-27 Thread Mike Driscoll
On Apr 27, 1:50 pm, "Gabriel Genellina" wrote: > En Thu, 23 Apr 2009 16:44:25 -0300, Lawson English   > escribió: > > > Can anyone tell me why these two behave differfently? > > >http://pastebin.com/m57bee079vs  http://pastebin.com/m3c044b29 > > The code is so different that I don't see why they

PyGame font issues

2009-04-27 Thread Peter Chant
Chaps, I have the following code: if pygame.font: font = pygame.font.Font(None, 36) #font = pygame.font.Font('liberationserif',36) text = font.render("Esc to quit.", 1, (10, 10, 10)) textpos = text.get_rect() textpos.centerx = background.get_rect().centerx background.blit(

Re: python list handling and Lisp list handling

2009-04-27 Thread Daniel Stutzbach
On Fri, Apr 24, 2009 at 10:19 AM, Mark Tarver wrote: > but also says that their representation is implementation dependent. > As far as I see this should mean that element access in Python should > run in constant time. Now if so this is a boon, because generally > When I first learned Python, I

Re: is PyCodec_Encode API able to change encoding fron UCS-2 to UCS-4

2009-04-27 Thread Gabriel Genellina
En Mon, 27 Apr 2009 08:56:44 -0300, rahul escribió: is this generic API can be use to change ucs-2 to ucs-4 PyObject * PyCodec_Encode( PyObject *object, const char *encoding, const char *errors ); if yes than what is the format of denoting ucs-4, because i try to d

Re: is PyCodec_Encode API able to change encoding fron UCS-2 to UCS-4

2009-04-27 Thread Gabriel Genellina
En Mon, 27 Apr 2009 08:56:44 -0300, rahul escribió: is this generic API can be use to change ucs-2 to ucs-4 I forget to comment on UCS-2 and UCS-4. Python does not support them directly; use utf-16 and utf-32 instead. If you start with an encoded string in UCS-2, the differences are irrel

Re: Cannot find text in *.py files with Windows Explorer?

2009-04-27 Thread Terry Reedy
John Doe wrote: Terry Reedy wrote: John Doe wrote: John Doe wrote: ... Another file manager, FreeCommander, does find text in Python files. However... It does not have Undo! Potentially risky. Undo is an editor function. I do not believe Windows Explore has Undo either. Besides Undo.

SSL Server side Client Certficate Verification in M2Crypto

2009-04-27 Thread Karthik
Hi, I have a small problem using the M2Crypto for SSL certificate verification. I have a client and a server who wants to get the certificates verified by the other in order start the communication. I am able to get the server certificate verified by the client but not the client certificate in t

Re: Cannot find text in *.py files with Windows Explorer?

2009-04-27 Thread John Doe
Terry Reedy wrote: > John Doe wrote: ... >> Windows Explorer does include Undo. > > I learn something new. In my WinXP, I found that Explorer has 'Undo > Move' (good to learn actually, for when I drop a file in the wrong > place), Yup! FWIW... I enable the Windows Explorer status bar her

Re: OT: a metacomment on feedback comments

2009-04-27 Thread Aaron Watters
Regarding feedback about WHIFF -- WSGI/HTTP Integrated Filesystems Frames On Apr 23, 3:43 pm, Aaron Watters wrote: > On Apr 23, 11:54 am, Johannes Bauer wrote: > > > To sum it up, I think it's a neat idea, but it's not really intuitive. > > After being quite startled at first it got better a

Re: pyflakes, pylint, pychecker - and other tools

2009-04-27 Thread Esmail
Zooko O'Whielacronx wrote: I like pyflakes. I haven't tried the others. I made a setuptools plugin named "setuptools_pyflakes". If you install that package, then "python ./setup.py flakes" runs pyflakes on your package. Regards, Thanks Zooko I decided to give all of them a try :-) Esmai

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread David Bolen
Vsevolod writes: > "This should be used with caution: it is implementation-defined > whether the thread runs cleanup forms or releases its locks first." > This doesn't mean deprecated. It means: implementation-dependent. For > example in SBCL: "Terminate the thread identified by thread, by > caus

Re: Dynamically fill prepared (PDF?) forms

2009-04-27 Thread Alia K
pom wrote: > So I want to create PDF output based on an external layout file. You can allow for a transformation file which is read by your program to change the layout of the output. Think templates. AK -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread Paul Rubin
David Bolen writes: > I'm curious - do you know what happens if threading is implemented as > a native OS thread and it's stuck in an I/O operation that is blocked? > How does the Lisp interpreter/runtime gain control again in order to > execute the specified function? I guess on many POSIX-ish >

Re: CSV performance

2009-04-27 Thread dean
On Mon, 27 Apr 2009 04:22:24 -0700 (PDT), psaff...@googlemail.com wrote: > I'm using the CSV library to process a large amount of data - 28 > files, each of 130MB. Just reading in the data from one file and > filing it into very simple data structures (numpy arrays and a > cstringio) takes around

Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Gunter Henriksen
I am interested in the lightest mechanism to use in a Python application for mutex/wait/notify between processes, one of which may be a program which does not have a shared ancestral benefactor, or may not be a Python program at all. I would ideally like to have something which does not need to ma

Get objects from ZODB into MySQL

2009-04-27 Thread TheIvIaxx
Hello, I have searched for some solution to getting the object data from a ZODB Data.fs file into something i can work with for MySQL. So far, no such luck. I can open the DB and poke around, but im not sure where or what to even poke :) It was a simple plone site, with mainly Pages/Documents (t

Re: Get objects from ZODB into MySQL

2009-04-27 Thread Diez B. Roggisch
TheIvIaxx schrieb: Hello, I have searched for some solution to getting the object data from a ZODB Data.fs file into something i can work with for MySQL. So far, no such luck. I can open the DB and poke around, but im not sure where or what to even poke :) It was a simple plone site, with main

Re: Get objects from ZODB into MySQL

2009-04-27 Thread Gabriel Genellina
En Mon, 27 Apr 2009 19:13:39 -0300, TheIvIaxx escribió: Hello, I have searched for some solution to getting the object data from a ZODB Data.fs file into something i can work with for MySQL. So far, no such luck. I can open the DB and poke around, but im not sure where or what to even poke

Re: mailbox.mbox.add() sets access time as well as modification time

2009-04-27 Thread Lawrence D'Oliveiro
In message , Aahz wrote: > In article , > Lawrence D'Oliveiro wrote: >> >>It's only in the proprietary-software world that we need to worry about >>backward compatibility with old, obsolete software that the vendors >>cannot or will not fix. In the Free Software world, we fix the software >>to b

Re: mailbox.mbox.add() sets access time as well as modification time

2009-04-27 Thread Lawrence D'Oliveiro
In message , Grant Edwards wrote: > On 2009-04-26, Lawrence D'Oliveiro > wrote: > >> In message <_vqdnf6pny1gymzunz2dnuvz_qcdn...@posted.visi>, Grant Edwards >> wrote: >> >>> ... if one didn't care about backwards-compatiblity with old e-mail >>> apps, then one would use a less broken mailbox fo

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Lawrence D'Oliveiro
In message , Gunter Henriksen wrote: > I would ideally like to have something which does > not need to make a system call in an uncontended > case for the mutex. In Linux you could use a futex. -- http://mail.python.org/mailman/listinfo/python-list

Re: Get objects from ZODB into MySQL

2009-04-27 Thread William Heymann
On Monday 27 April 2009, TheIvIaxx wrote: > Hello, I have searched for some solution to getting the object data > from a ZODB Data.fs file into something i can work with for MySQL. So > far, no such luck. I can open the DB and poke around, but im not sure > where or what to even poke :) > Normal

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Paul Rubin
Gunter Henriksen writes: > A thin layer over pthreads would be nice, or which > is using POSIX semaphores/queues would be ok.  I > can use mmap for shared memory; that is not problem. > The synchronization is where I need help. Try this: http://nikitathespider.com/python/shm/ -- http://mail.pytho

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Paul Hemans
The reason I started down this path is that the program is grinding to a halt (my PC as well) and the only way to get it going again is: >>>import gc >>>gc.collect() 2524104 Memory used by the process is around 500MB, I have posted about this problem before on this newsgroup but I didn't get a r

can't use "glog" to find the path with square bracket

2009-04-27 Thread winterTTr
I want to list the file with glob . The path( which is a directory ) is contain square bracket as "[ab] xxx" . However , i can't find how to do it rightly with glob . with the coding : {{{ import glob glob.glob('[ab]xxx' ) }}} and with the path "[ab]xxx" really exits. result : [] Is there a wa

Re: Is there a maximum size to a Python program?

2009-04-27 Thread andrew cooke
not sure i've read all the posts on this, and i don't fully understand the problem, but someone's mentioned sqlalchemy, so here's my experience with that and large updates using mapped objects. 1 - don't commit each object as you modify it. instead, process a whole pile in memory and then (perha

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Paul Rubin
Gunter Henriksen writes: > > Try this: http://nikitathespider.com/python/shm/ > > I took a look at that (especially the posix_ipc at > http://semanchuk.com/philip/posix_ipc/). I am hoping not to plug > something underneath the Python VM; I would rather use a socket, or > use signals. I'm not s

How can I get Tkinter to work in Python? (I tried many things)

2009-04-27 Thread tomzam
I am trying to get Tkinter to work with my Python build. I've scoured usenet(comp.lang.Python) and google and there's information that's helpful but I just can't seam to get it completely right. I tried many of the suggestion, but nothing seems to work My setup is Fedora Cor

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Gunter Henriksen
> Try this: http://nikitathespider.com/python/shm/ I took a look at that (especially the posix_ipc at http://semanchuk.com/philip/posix_ipc/). I am hoping not to plug something underneath the Python VM; I would rather use a socket, or use signals. If I were to use a C library, I imagine I would

  1   2   >