berkeley db in concurrent environment

2010-11-26 Thread
Hi list, I'm using bsddb.dbshelve in a conservative and concurrent environment (python version 2.4). I'm wondering if the dbshelve class methods are atomic. That is, if one process keeps writing data to one database file and another process keeps reading from it, will the reading process get incom

Re: Newbie subprocess question

2010-11-26 Thread News123
On 11/26/2010 12:18 AM, Tim Harig wrote: > On 2010-11-25, Hugo Léveillé wrote: >> I'm starting various application using subprocess.Popen without any >> problem. The problem is with application inside "Program Files". It >> looks like subprocess is stopping the application string after >> "Program

Re: Scheme as a virtual machine?

2010-11-26 Thread Benjamin L. Russell
namekuseijin writes: > I have to say I'm always amazed how ad hominens can generate quite > strong responses to the point of making a lot of new faces (or mail > accounts) suddenly appear... ;) Actually, I had just noticed that aspect as well. Is it just me, or does anybody else also think it r

Re: Scheme as a virtual machine?

2010-11-26 Thread Benjamin L. Russell
dekudekup...@yahoo.com (Benjamin L. Russell) writes: > When I was a student at my college, one of the students once told me a > secret about how a computer program ran by a professor for a course in > introduction to systems programming checked to ensure that the students > who were submitting hom

Re: Parsing markup.

2010-11-26 Thread Jon Clements
On Nov 26, 4:03 am, MRAB wrote: > On 26/11/2010 03:28, Joe Goldthwaite wrote: >  > I’m attempting to parse some basic tagged markup.  The output of the >  > TinyMCE editor returns a string that looks something like this; >  > >  > This is a paragraph with bold and italic elements in >  > itIt can

How to parse a text block?

2010-11-26 Thread Sergey Smirnov
Hi all. I have a lot of text blocks that looks like this one *** Layer 3 Message type: CP-Data Device: MS1 Time: 19:57:44.71 CP-User data length : 37 RPDU Message type indicator (MTI) : (1) RP-DATA The question is how to parse given text block into a dictionary that looks like the dicti

Re: SQLite date fields

2010-11-26 Thread Duncan Booth
Tim Roberts wrote: >>However, when it comes to writing-back data to the table, SQLite is >>very forgiving and is quite happy to store '25/06/2003' in a date >>field, > > SQLite is essentially typeless. ALL fields are stored as strings, > with no interpretation. You can store whatever you want

passing a tuple into a class function as a single argument

2010-11-26 Thread greyw...@gmail.com
Hi everyone, The following program doesn't work as expected: #Python 2.7 & wxPython 2.9 import wx class MyFrame(wx.Frame): """ We simply derive a new class of Frame. """ def __init__(self, parent, title): wx.Frame.__init__(self, parent, title=title, size=(200,100)) self

Re: passing a tuple into a class function as a single argument

2010-11-26 Thread Mel
greyw...@gmail.com wrote: > Hi everyone, > > The following program doesn't work as expected: > > > #Python 2.7 & wxPython 2.9 > > import wx > > class MyFrame(wx.Frame): > """ We simply derive a new class of Frame. """ > def __init__(self, parent, title): > wx.Frame.__init__(se

Re: what a cheap rule

2010-11-26 Thread Fuzzyman
On Nov 26, 1:10 am, Steven D'Aprano wrote: > On Thu, 25 Nov 2010 08:15:21 -0800, Yingjie Lan wrote: > > Intuition #1: as if you raise an exception type, and then match that > > type. > > It seems that no instances > > are involved here (Intuitively). > > Your intuition is not my intuition, nor doe

Re: Needed: Real-world examples for Python's Cooperative Multiple Inheritance

2010-11-26 Thread Michele Simionato
On Nov 24, 9:08 pm, Raymond Hettinger wrote: > So far, the only situation I can find where method names necessarily > overlap is for the basics like __init__(), close(), flush(), and > save() where multiple parents need to have their own initialization > and finalization. I do not know of other

Re: Help with suds: HTTP Error 401

2010-11-26 Thread Oskar
I was having the same issue until I updated suds to the newest version. -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLite date fields

2010-11-26 Thread Tim Chase
On 11/26/2010 07:20 AM, Duncan Booth wrote: Tim Roberts wrote: SQLite is essentially typeless. ALL fields are stored as strings, with no interpretation. You can store whatever you want in any column. The column types are basically there to remind YOU how to handle the data. Not all fields

ANN: Leo 4.8 final

2010-11-26 Thread Edward K. Ream
Leo 4.8 final is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.html The highlights of Leo 4.8: -- - Leo no

Re: PyQt Installation Problem on Windows

2010-11-26 Thread Hans-Peter Jansen
On Wednesday 24 November 2010, 23:03:14 Saul Spatz wrote: > Hi, > > I've been trying to install PyQt on Windows XP Pro so that I can try > out eric ide. I used the binary windows installer for PyQt. I can > run eric as administrator, but not with my ordinary user account. By > running eric.bat w

Re: playful coding problems for 10 year olds

2010-11-26 Thread Aahz
In article , Daniel Fetchinson wrote: > >My niece is interested in programming and python looks like a good >choice (she already wrote a couple of lines :)) She is 10 and I thought >it would be good to have a bunch of playful coding problems for her, >stuff that she could code herself maybe after

Kind of plugin system

2010-11-26 Thread Gaëtan Podevijn
Hello, Here is my problem. I need to get some informations from files stored on my filesystem, Flickr and Picasa. So the idea is to create a class (for instance, "InformationsProvider") that provides common methods for those three sources, then, for each source, I create a class that inherits fro

Dictionaries inside out

2010-11-26 Thread Greg Lindstrom
I am working on a project where I'm using dictionaries to hold the translations to codes (i.e., {'1':'Cheddar','2':'Ice Hockey','IL':'Thermostat Broken'}). The bulk of the application requires me to translate codes to their meaning, but it would be nice to be able to translate a meaning back to th

Re: Dictionaries inside out

2010-11-26 Thread Burton Samograd
Greg Lindstrom writes: > I am working on a project where I'm using dictionaries to hold the > translations to codes (i.e., {'1':'Cheddar','2':'Ice > Hockey','IL':'Thermostat Broken'}).  The bulk of the application > requires me to translate codes to their meaning, but it would be nice > to be abl

Re: inverse of a matrix with Fraction entries

2010-11-26 Thread casevh
On Nov 25, 1:28 pm, Daniel Fetchinson wrote: > Okay, I see your point and I completely agree. > Surely it will be faster to do it with integers, will give it a shot. > > Cheers, > Daniel > > -- > Psss, psss, put it down! -http://www.cafepress.com/putitdown You may want to look at using GMPY. GMP

Re: Dictionaries inside out

2010-11-26 Thread Gaëtan Podevijn
Found in Dive in Python 3 : >>> a_dict = {'a': 1, 'b': 2, 'c': 3} >>> {value:key for key, value in a_dict.items()} {1: 'a', 2: 'b', 3: 'c'} 2010/11/26 Burton Samograd > Greg Lindstrom writes: > > > I am working on a project where I'm using dictionaries to hold the > > translations to codes (i

Re: a regexp riddle: re.search(r'(?:(\w+), |and (\w+))+', 'whatever a, bbb, and c') =? ('a', 'bbb', 'c')

2010-11-26 Thread Aahz
In article , Phlip wrote: > >Thanks all for playing! And as usual I forgot a critical detail: > >I'm writing a matcher for a Morelia /viridis/ Scenario step, so the >matcher must be a single regexp. Why? (You're apparently the author of Morelia, but I don't really understand it.) -- Aahz (a...

Re: Needed: Real-world examples for Python's Cooperative Multiple Inheritance

2010-11-26 Thread John Nagle
On 11/25/2010 5:36 PM, Raymond Hettinger wrote: On Nov 25, 3:38 pm, John Nagle wrote: Best practice for this is "don't do it." Some name clashes ought to simply be detected as errors, rather than being given such complex semantics. That may well be true. If a coder has enough control

Re: inverse of a matrix with Fraction entries

2010-11-26 Thread John Nagle
On 11/24/2010 10:30 AM, Robert Kern wrote: On 11/24/10 12:07 PM, Daniel Fetchinson wrote: The whole story is that I have a matrix A and matrix B both of which have rational entries and they both have pretty crazy entries too. Their magnitude spans many orders of magnitude, but inverse(A)*B is a

Re: Matlab equivalent syntax in Python

2010-11-26 Thread Akand Islam
On Nov 26, 12:37 am, Tim Roberts wrote: > Akand Islam wrote: > > >Can anyone please suggest me what will be the good way to use matlab > >equivalent of "profile clear, profile on, profile off, profile resume > >and profile viewer" in Python? > > Python has a number of ways of measuring elapsed ti

Re: Dictionaries inside out

2010-11-26 Thread Terry Reedy
On 11/26/2010 1:13 PM, Greg Lindstrom wrote: I am working on a project where I'm using dictionaries to hold the translations to codes (i.e., {'1':'Cheddar','2':'Ice Hockey','IL':'Thermostat Broken'}). The bulk of the application requires me to translate codes to their meaning, but it would be ni

Re: Matlab equivalent syntax in Python

2010-11-26 Thread Cameron Simpson
On 26Nov2010 13:15, Akand Islam wrote: | Thanks for your posting. Like, here is the following Matlab codes | which I am trying to transform into Python. Here you | will find "profile clear, profile on, profile off, profile resume, | profile viewer, and drawnow" syntaxes. So, what will be these | e

Re: inverse of a matrix with Fraction entries

2010-11-26 Thread Steven D'Aprano
On Fri, 26 Nov 2010 12:54:12 -0800, John Nagle wrote: > For ordinary number crunching, > rational arithmetic is completely inappropriate. Why? -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionaries inside out

2010-11-26 Thread Ben Finney
(Replying to Greg, though his original message doesn't appear at Gmane.) > Greg Lindstrom writes: > > > I am working on a project where I'm using dictionaries to hold the > > translations to codes (i.e., {'1':'Cheddar','2':'Ice > > Hockey','IL':'Thermostat Broken'}).  The bulk of the application

Symposium “Computational Methods in Image Analysis ” within the USNCCM 11 Congress – Announce & Call for Pa pers

2010-11-26 Thread tava...@fe.up.pt
Dear Colleague, Within the 11th U.S. National Congress on Computational Mechanics (USNCCM 11 - www.usnccm.org), to be held in Minnesota, USA, in July 25-29, 2011, we are organizing the Symposium “Computational methods in image analysis”. Examples of some topics that will be considered in the sympo

Re: Dictionaries inside out

2010-11-26 Thread Ben Finney
Ben Finney writes: > code_by_desc = dict( > (desc, code) for (code, desc) in codes_to_messages.items()) Bah, I fumbled an edit. Try this:: code_by_desc = dict( (desc, code) for (code, desc) in desc_by_code.items()) -- \“The reason we come up with new versions

Re: Matlab equivalent syntax in Python

2010-11-26 Thread Akand Islam
On Nov 26, 3:50 pm, Cameron Simpson wrote: > On 26Nov2010 13:15, Akand Islam wrote: > | Thanks for your posting. Like, here is the following Matlab codes > | which I am trying to transform into Python. Here you > | will find "profile clear, profile on, profile off, profile resume, > | profile vie

Re: Needed: Real-world examples for Python's Cooperative Multiple Inheritance

2010-11-26 Thread Mark Wooding
John Nagle writes: > I'd argue that a better implementation would require that when there's > a name clash, you have to specify the class containing the name. In > other words, if A is a subclass of B, then B.foo() overrides > A.foo(). But if C is a subclass of A and B, and there's an A.foo() an

Re: SQLite date fields

2010-11-26 Thread Alan Harris-Reid
To all those who have replied on this thread - many thanks. It looks as though I've got to look further into date objects, SQLite's native date functions, detect_types, etc.. Regards, Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: inverse of a matrix with Fraction entries

2010-11-26 Thread casevh
On Nov 26, 2:11 pm, Steven D'Aprano wrote: > On Fri, 26 Nov 2010 12:54:12 -0800, John Nagle wrote: > > For ordinary number crunching, > > rational arithmetic is completely inappropriate. > > Why? > > -- > Steven As you perform repeated calculations with rationals, the size of the values (usually)

Re: Using Python for a demonstration in historical linguistics

2010-11-26 Thread Dax Bloom
On Nov 6, 6:41 am, Vlastimil Brom wrote: > 2010/11/6 Dax Bloom : > > > > > > > Hello, > > > In the framework of a project on evolutionary linguistics I wish to > > have a program to process words and simulate the effect of sound > > shift, for instance following the Rask's-Grimm's rule. I look to

Re: Using Python for a demonstration in historical linguistics

2010-11-26 Thread Dax Bloom
On Nov 6, 6:18 am, Peter Otten <__pete...@web.de> wrote: > Peter Otten wrote: > s = """ > > ... In the framework of a project onevolutionarylinguisticsI wish to > > ... have a program to process words and simulate the effect of sound > > ... shift, for instance following the Rask's-Grimm's rul

Re: Needed: Real-world examples for Python's Cooperative Multiple Inheritance

2010-11-26 Thread John Nagle
On 11/26/2010 4:21 PM, Mark Wooding wrote: John Nagle writes: I'd argue that a better implementation would require that when there's a name clash, you have to specify the class containing the name. In other words, if A is a subclass of B, then B.foo() overrides A.foo(). But if C is a subclass