[Tutor] FW: wierd replace problem

Roelof Wobben rwobben at hotmail.com
Mon Sep 13 20:24:11 CEST 2010




----------------------------------------
> From: rwobben at hotmail.com
> To: joel.goldstick at gmail.com
> Subject: RE: [Tutor] wierd replace problem
> Date: Mon, 13 Sep 2010 18:23:36 +0000
>
>
>
>
> ________________________________
>> Date: Mon, 13 Sep 2010 14:18:36 -0400
>> From: joel.goldstick at gmail.com
>> To: tutor at python.org
>> Subject: Re: [Tutor] wierd replace problem
>>
>>
>>
>> On Mon, Sep 13, 2010 at 2:08 PM, bob gailer
>>> wrote:
>> On 9/13/2010 1:50 PM, Roelof Wobben wrote:
>>
>> [snip]
>>
>> hello Alan,
>>
>> Your right. Then it prints like this "'tis
>> Which is not right. It must be tis.
>> So the replace does not what it supposed to do.
>>
>> Sorry but I am now more confused. After discovering no \ in the text
>> file now you seem to have have a new specification, which is to get rid
>> of the '.
>>
>> I suggest you give a clear, complete and correct problem statement.
>> Right now we are shooting in the dark at a moving target.
>>
>> Something like.
>>
>> Given the file alice_in_wonderland.txt, copied from url so-and-so
>>
>> Remove these characters ...
>>
>> Split into words (not letters?) where word is defined as
>>
>> Count the frequency of each word.
>>
>>
>> --
>> Bob Gailer
>> 919-636-4239
>> Chapel Hill NC
>>
>> _______________________________________________
>> Tutor maillist - Tutor at python.org
>> To unsubscribe or change subscription options:
>> http://mail.python.org/mailman/listinfo/tutor
>>
>> How about using str.split() to put words in a list, then run strip()
>> over each word with the required characters to be removed ('`")
>>
>> --
>> Joel Goldstick
>>
>>
>> _______________________________________________ Tutor maillist -
>> Tutor at python.org To unsubscribe or change subscription options:
>> http://mail.python.org/mailman/listinfo/tutor
>

Hello Joel.

That can be a solution but when i have --dark the -- must be removed.
But in a-piece the - must not be removed.

Roelof 		 	   		  


More information about the Tutor mailing list