Python file modification

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

tsunam

Thread Starter
Joined
Sep 14, 2003
Messages
1,240
Alright in a file I have:

media-sound/beep-media-player 124
media-video/mplayer 678
www-client/mozilla-firefox 11278

Which when read creates a list that reads as such

['media-sound/beep-media-player 124\n', 'media-video/mplayer 678\n', 'www-client/mozilla-firefox 11236\n']

I'm wondering how I can match a since entry in the list so that I can replace it.
 

tsunam

Thread Starter
Joined
Sep 14, 2003
Messages
1,240
I think I'l be able to do it with a index search based on a previously known value

something like:
section = clear.index('%s' % (data))

I should then be able to pop that record out and then add it back in at the end.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top