[Tutor] Working with files

Scott Oertel me at scottoertel.info
Thu Aug 25 02:02:15 CEST 2005

Byron wrote:

>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"
>>   "what"
>>   the rest of the original string
>>write the new string to the file
>Hi Scott,
>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.
>Take care,
>Tutor maillist  -  Tutor at python.org
Thanks again,

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.

-Scott Oertel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050825/48dded27/attachment.htm

More information about the Tutor mailing list