[Tutor] Working with files
me at scottoertel.info
Thu Aug 25 02:02:15 CEST 2005
>Bob Gailer wrote:
>>read the file into a string variable (assuming the file is not humungus)
>>find the location of "something" in the string
>>assemble a new string consisting of:
>> the original string up to the location (index) of "something"
>> the rest of the original string
>>write the new string to the file
>Bob gave you the basic instructions that you need to complete the task
>that you are asking for. If you don't know how to do this, I would
>suggest that you start with the following Python tutorial:
>They provide an excellent tutorial for learning the basics of Python --
>and best of all, it's free and written for absolute beginners.
>Tutor maillist - Tutor at python.org
I figured it out with the index function of the file objects, I didn't
know that you could search for a word and find the exact pos of it, that
was the tiny bit of information I was looking for.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor