Re: Installing PyGame?

2014-04-26 Thread Andrea D'Amore
On 2014-04-25 23:57:21 +, Gregory Ewing said: I don't know what you're doing to hose your system that badly. I've never had a problem that couldn't be fixed by deleting whatever the last thing was I added that caused it. The actual problem with the "native MacOSX way" is that there's no of

Re: Installing PyGame?

2014-04-26 Thread Andrea D'Amore
On 2014-04-25 23:42:33 +, Gregory Ewing said: That's fine if it works, but the OP said he'd already tried various things like that and they *didn't* work for him. By reading the "original" message (the empty reply with full quote of a ten months earlier message) I couldn't figure what the

Re: Unicode in Python

2014-04-26 Thread wxjmfauth
== I wrote once 90 % of Python 2 apps (a generic term) supposed to process text, strings are not working. In Python 3, that's 100 %. It is somehow only by chance, apps may give the illusion they are properly working. jmf -- https://mail.python.org/mailman/listinfo/python-list

Re: possible bug in re expression?

2014-04-26 Thread Steven D'Aprano
On Fri, 25 Apr 2014 14:32:30 -0400, Terry Reedy wrote: > On 4/25/2014 12:30 PM, Robin Becker wrote: [...] >> should >> >> re.compile('.{1,+3}') >> >> raise an error? It doesn't on python 2.7 or 3.3. > > And it should not because it is not an error. '+' means 'match 1 or more > occurrences of the

Re: Unicode in Python

2014-04-26 Thread Frank Millman
wrote in message news:03bb12d8-93be-4ef6-94ae-4a02789ae...@googlegroups.com... > == > > I wrote once 90 % of Python 2 apps (a generic term) supposed to > process text, strings are not working. > > In Python 3, that's 100 %. It is somehow only by chance, apps may > give the illusion they

Re: Unicode in Python

2014-04-26 Thread Ben Finney
"Frank Millman" writes: > wrote […] > It is quite frustrating when you make these statements without > explaining what you mean by 'not working'. Please do not engage “wxjmfauth” on this topic; he is an amply-demonstrated troll with nothing tangible to back up his incessant complaints about Un

Re: Help with changes in traceback stack from Python 2.7 to Python 3.x

2014-04-26 Thread Ned Batchelder
On 4/26/14 1:50 AM, Andrew Konstantaras wrote: I wrote the following code that works in Python 2.7 that takes the variables passed to the function into a dictionary. The following call: strA = 'a' intA = 1 dctA = makeDict(strA, intA) produces the following dictionary:

Re: Unicode in Python

2014-04-26 Thread Ian Kelly
On Apr 26, 2014 3:46 AM, "Frank Millman" wrote: > > > wrote in message > news:03bb12d8-93be-4ef6-94ae-4a02789ae...@googlegroups.com... > > == > > > > I wrote once 90 % of Python 2 apps (a generic term) supposed to > > process text, strings are not working. > > > > In Python 3, that's 100

Re: Help with changes in traceback stack from Python 2.7 to Python 3.x

2014-04-26 Thread Ian Kelly
On Apr 26, 2014 8:12 AM, "Ned Batchelder" wrote: > Looking at your code, I see: > > > tplArgs = map(None, lstVarNames, args) > > I didn't realize map accepted a callable of None (TIL!), but it no longer does in Python 3. You'll have to do this a different way. The Python 3 replacement for ma

Re: how to split this kind of text into sections

2014-04-26 Thread oyster
First of all, thank you all for your answers. I received python mail-list in a daily digest, so it is not easy for me to quote your mail separately. I will try to explain my situation to my best, but English is not my native language, I don't know whether I can make it clear at last. Every SECTIO

Re: feedparser error

2014-04-26 Thread Kushal Kumaran
tad na writes: > python 2.7.2 > > The following code has an error and I can not figure out why: > > import feedparser > d = feedparser.parse('http://bl.ocks.org/mbostock.rss') > numb = len(d['entries']) > for post in d.entries: > print post.pubDate+"\n" > > ---

Re: feedparser error

2014-04-26 Thread MRAB
On 2014-04-26 03:16, tad na wrote: python 2.7.2 The following code has an error and I can not figure out why: import feedparser d = feedparser.parse('http://bl.ocks.org/mbostock.rss') numb = len(d['entries']) for post in d.entries: print post.pubDate+"\n" -

Re: how to split this kind of text into sections

2014-04-26 Thread Tim Chase
On 2014-04-26 23:53, oyster wrote: > I will try to explain my situation to my best, but English is not my > native language, I don't know whether I can make it clear at last. Your follow-up reply made much more sense and your written English is far better than many native speakers'. :-) > Every S

Re: feedparser error

2014-04-26 Thread tad na
You guys are good. thanks. === On Saturday, April 26, 2014 11:55:35 AM UTC-5, MRAB wrote: On 2014-04-26 03:16, tad na wrote: python 2.7.2 The following code has an error and I can not figure out why: import feedparser d = feedparser.parse('http://bl.oc

Re: Proper deletion of selected items during map iteration in for loop: Thanks to all

2014-04-26 Thread Charles Hixson
On 04/25/2014 10:53 AM, Charles Hixson wrote: What is the proper way to delete selected items during iteration of a map? What I want to do is: for (k, v) in m.items(): if f(k): # do some processing of v and save result elsewhere del m[k] But this gives (as should be expected):

Re: Proper deletion of selected items during map iteration in for loop: Thanks to all

2014-04-26 Thread Tim Chase
On 2014-04-26 12:25, Charles Hixson wrote: > I expect that I'll be deleting around 1/3 during > each iteration of the process...and then adding new ones back in. > There shouldn't be a really huge number of deletions on any > particular pass, but it will be looped through many times... If you have

Re: Proper deletion of selected items during map iteration in for loop

2014-04-26 Thread Peter Otten
Charles Hixson wrote: > What is the proper way to delete selected items during iteration of a > map? What I want to do is: > > for (k, v) in m.items(): > if f(k): ># do some processing of v and save result elsewhere >del m[k] > > But this gives (as should be expected): >

Re: Proper deletion of selected items during map iteration in for loop: Thanks to all

2014-04-26 Thread Steven D'Aprano
On Sat, 26 Apr 2014 12:25:27 -0700, Charles Hixson wrote: > On 04/25/2014 10:53 AM, Charles Hixson wrote: >> What is the proper way to delete selected items during iteration of a >> map? What I want to do is: >> >> for (k, v) in m.items(): >>if f(k): >> # do some processing of v and sa

Re: Proper deletion of selected items during map iteration in for loop: Thanks to all

2014-04-26 Thread Chris Angelico
On Sun, Apr 27, 2014 at 12:14 PM, Steven D'Aprano wrote: > I think the two obviously good enough approaches are: > > - save a "to be deleted" list, then delete those keys; > > - copy the "not to be deleted" items into a new dict For a small enough dict that the performance question doesn't matter

Re: how to split this kind of text into sections

2014-04-26 Thread Steven D'Aprano
On Sat, 26 Apr 2014 23:53:14 +0800, oyster wrote: > Every SECTION starts with 2 special lines; these 2 lines is special > because they have some same characters (the length is not const for > different section) at the beginning; these same characters is called the > KEY for this section. For every

Re: Proper deletion of selected items during map iteration in for loop: Thanks to all

2014-04-26 Thread Roy Smith
In article <535c67e9$0$29965$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > I think the two obviously good enough approaches are: > > - save a "to be deleted" list, then delete those keys; > > - copy the "not to be deleted" items into a new dict There is a third possibility: I