[Tutor] Python help!!

taserian taserian at gmail.com
Tue Apr 2 19:13:13 CEST 2013


On Tue, Apr 2, 2013 at 12:49 PM, David Mitchell <d_mitchell89 at hotmail.com>wrote:

> Hi!
>
> How do I go through a text file, finding specific words/numbers/phrases
> and edit them to say different things? I do not want to edit the text file,
> I would rather open and read from the text file and write to a new file.
>
> I do NOT want to know how to replace a specific word with another every
> time it appears. There are some "OFF" 's that i would like to change to
> "ON" 's and some that I would like to change to "OPEN" for example.
>

How would you know which ones to change to "ON" and which ones to change to
"OPEN"? Additionally, how would you describe those conditions in Python?


Antonio Rodriguez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130402/462ee801/attachment.html>


More information about the Tutor mailing list