Reading \n unescaped from a file
anthra.norell at bluewin.ch
Fri Sep 4 11:38:37 CEST 2015
My response was meant for the list, but went to Peter by mistake. So I
repeat it with some delay:
On 09/03/2015 04:24 PM, Peter Otten wrote:
> Friedrich Rentsch wrote:
>> On 09/03/2015 11:24 AM, Peter Otten wrote:
>>> Friedrich Rentsch wrote:
>> I appreciate your identifying two mistakes. I am curious to know what
>> they are.
> Sorry for not being explicit.
>>>> substitutes = [self.table [item] for item in hits if item
>>>> in valid_hits] +  # Make lengths equal for zip to work right
>>> That looks wrong...
> You are adding an empty list here. I wondered what you were trying to
> achieve with that.
Right you are! It doesn't do anything. I remember my idea was to pad the
substitutes list by one, because the list of intervening text segments
is longer by one element and zip uses the least common length,
discarding all overhang. The remedy was totally ineffective and, what's
more, not needed, judging by the way the editor performs as expected.
>>>> output = input
>>> ...and so does this.
> That seems to be the only occurence of the name "input" in your code. Did
> you mean "text" or do you really want to return the built-in?
Right you are again! I did mean text. I changed a few names to make them
more suggestive, and apparently missed this one.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list