Re: good design & method calls

2005-03-29 Thread Charles Hartman
On Mar 29, 2005, at 10:36 AM, Peter Hansen wrote: Sorry for the rant... I didn't intend it to head that way when I started out, but I seem to be on a bit of an anti-optimization bent today. :-) No, that's very helpful; thanks. Charles Hartman -- http://mail.python.org/mailman/listinfo/python-list

good design & method calls

2005-03-29 Thread Charles Hartman
sses local variables much more efficiently than global variables." These two pieces of advice imply opposite kinds of code revisions. Obviously they have different purposes, and both are right at different times. I wonder if anyone has some wisdom about how to think about when or how often to d

Re: list-comprehension and map question (simple)

2005-03-27 Thread Charles Hartman
I very much take your point. And thanks: that answers my syntax question (I think!) -- *and* tells me that I don't care. Charles Hartman On Mar 27, 2005, at 2:16 PM, [EMAIL PROTECTED] wrote: ... >>> simpler == complexities True >>> I've not the glimmer of a clue whic

Re: list-comprehension and map question (simple)

2005-03-27 Thread Charles Hartman
onary whose keys are those two-item tuples and whose values are the integers returned by self._measureComplexity Charles Hartman -- http://mail.python.org/mailman/listinfo/python-list

Re: list-comprehension and map question (simple)

2005-03-27 Thread Charles Hartman
s is quite cool, and it looks as though it would work with more complicated function calls than the ones in my toy example. Thanks. Charles Hartman -- http://mail.python.org/mailman/listinfo/python-list

list-comprehension and map question (simple)

2005-03-27 Thread Charles Hartman
er/_sandbox.py", line 1, in addone # Used internally for debug sandbox under external interpreter TypeError: unsupported operand type(s) for +: 'function' and 'int' ) I hope the question is clear enough. I have a feeling I'm ignoring a simple technique . . . Charles Hartman -- http://mail.python.org/mailman/listinfo/python-list

character-filtering and Word (& company)

2005-03-25 Thread Charles Hartman
n marks and the like. Is there some well-known way to filter or translate this w.p. garbage? I don't know whether encodings are relevant; I don't know what encoding an MSW file uses. I don't see how to use s.translate() because I don't know how to predict what the incoming for

Re: breaking up is hard to do

2005-03-25 Thread Charles Hartman
ecially six months later. I'm sure people who know a lot better what they're talking about will have more thorough answers for you. Charles Hartman -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 18, Issue 391

2005-03-24 Thread Charles Hartman
ython docs is funny, and the didactic pose of the whole post is . . . derisory. The motive for the post escapes me, or I hope it does. Charles Hartman -- http://mail.python.org/mailman/listinfo/python-list

intrusive posts

2005-03-23 Thread Charles Hartman
On Mar 23, 2005, at 7:10 PM, [EMAIL PROTECTED] wrote: 7. (",) Do You Want To Know For Sure You Are Going To Heaven? Is there no way of filtering this recurring offensive material from the list? Charles Hartman -- http://mail.python.org/mailman/listinfo/python-list

Re: Text-to-speech

2005-03-21 Thread Charles Hartman
Maybe you can bind Festival (http://www.cstr.ed.ac.uk/projects/festival/download.html) with SWIG. Presumably somebody could; at this point it's well beyond me. But thank you for the suggestion. Charles Hartman http://cherry.conncoll.edu/cohar -- http://mail.python.org/mailman/listinfo/p

Re: Software for Poets (Was: Re: Text-to-speech)

2005-03-20 Thread Charles Hartman
On Mar 20, 2005, at 4:10 PM, Francis Girard wrote: Hello M. Hartman, It's a very big opportunity for me to find someone that both is a poet and knows something about programming. First, please excuse my bad english ; I'm a french canadian. My French is a great deal worse than your English; fear n

Re: Text-to-speech

2005-03-20 Thread Charles Hartman
even directly talked about in the boolk) that there came a casual remark from a reader last year which led to the Scandroid. Charles Hartman "The time has come for someone to put his foot down; and that foot is me." --Animal House On Mar 20, 2005, at 2:10 AM, Tim Churches wrote:

Text-to-speech

2005-03-19 Thread Charles Hartman
platforms, but I guess I'm asking too much -- it's too hardware dependent, I suppose. Any hints? Charles Hartman Professor of English, Poet in Residence http://cherry.conncoll.edu/cohar http://villex.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows question from Mac guy

2005-03-18 Thread Charles Hartman
simple way for 'darwin'. Many thanks! Charles Hartman -- http://mail.python.org/mailman/listinfo/python-list

Windows question from Mac guy

2005-03-18 Thread Charles Hartman
though yes I *can* navigate to the right place.) This is pretty much the same code I use when the user selects "Load text file," and the app goes straight to the right directory (its own directory), where it finds a sample text file I supply. Is os.getcwd() working differently in the

Re: newbie: modifying a string in python

2005-03-16 Thread Charles Hartman
offer more efficient solutions. Charles Hartman Professor of English, Poet in Residence http://cherry.conncoll.edu/cohar http://villex.blogspot.com want to modify a string in the following way : for s in stks:   s = s.strip()   if ( s[-2:] == ‘GR’ ):   s[-2:]= ‘GF’   so, if the

Re: Python-list Digest, Vol 18, Issue 208

2005-03-13 Thread Charles Hartman
s how you tell Python you're entering an octal number. (Parallel to 0x for hexadecimals.) So beware of 010, which isn't the number of fingers you presumably have, unless you don't count the thumbs. Charles Hartman -- http://mail.python.org/mailman/listinfo/python-list

Re: a RegEx puzzle (end of thread)

2005-03-12 Thread Charles Hartman
Won't extend this except to say thanks to Michael Spencer for another version. If I were doing it only once I'd use that. Since I do it more than once I should package it as a function. Thanks. Charles Hartman Professor of English, Poet in Residence http://cherry.conncoll.edu/

Re: a RegEx puzzle

2005-03-11 Thread Charles Hartman
ired changing > into >=, which even I can't screw up. Thanks to everyone who's helped on this. Makes me wish I were going to pycon. Charles Hartman Professor of English, Poet in Residence http://cherry.conncoll.edu/cohar http://villex.blogspot.com Kent Johnson wrote: It's

Re: a RegEx puzzle

2005-03-11 Thread Charles Hartman
it's any more efficient and/or elegant than what I've got now. Hm -- lots to think about here. Thank you. Charles Hartman Professor of English, Poet in Residence http://cherry.conncoll.edu/cohar http://villex.blogspot.com pat = sre.compile('(x[x/])+') (longest, startlongest) = ma

Re: a RegEx puzzle

2005-03-11 Thread Charles Hartman
Charles Hartman <[EMAIL PROTECTED]> wrote: I'm still shaky on some of sre's syntax. Here's the task: I've got strings (never longer than about a dozen characters) that are guaranteed to be made only of characters 'x' and '/'. One possibility i

hotshot ??

2005-03-11 Thread Charles Hartman
--which I don't understand. (The program is a GUI one using wxPython 2.5, running from within the WingIDE on a Mac under OS 10.3.8, if any of that makes a difference. Nothing there prevents hotshot from loading a file that's been made without the lineevents=1 argument.) Charles H

a RegEx puzzle

2005-03-11 Thread Charles Hartman
the details (I'm even shakier on generators than I am on regexes!) and (2) that *seems* likely to be less efficient, maybe by a large enough factor that the obnoxiousness of getting the first search-return seven times is something I should just swallow. What magic am I missing? Charles Hartman Professor of English, Poet in Residence http://cherry.conncoll.edu/cohar http://villex.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

hotshot load error

2005-03-09 Thread Charles Hartman
from within the WingIDE on a Mac under OS 10.3.8, if any of that makes a difference. Nothing there prevents hotshot from loading a file that's been made without the lineevents=1 argument.) Charles Hartman Professor of English, Poet in Residence http://cherry.conncoll.edu/cohar http://villex.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list