Re: delete first line in a file
- From: Michele Petrazzo <michele.petrazzo@xxxxxxxxxxxxxx>
- Date: Fri, 30 Jun 2006 11:27:57 GMT
Juergen Huber wrote:
but...how can i say python, delete the first line?!
thats my problem!
You can open the file, read its lines with readlines function ( that return a list), so make your modifies and save to another file.
Now, do you know how to work with lists?
http://python.org/doc/2.4.2/tut/node5.html#SECTION005140000000000000000
and now you have only to wrote it
http://python.org/doc/2.4.2/tut/node9.html#SECTION009200000000000000000
Michele
.
- References:
- delete first line in a file
- From: Juergen Huber
- Re: delete first line in a file
- From: Fredrik Lundh
- Re: delete first line in a file
- From: Juergen Huber
- Re: delete first line in a file
- From: Fredrik Lundh
- Re: delete first line in a file
- From: Juergen Huber
- delete first line in a file
- Prev by Date: Re: Way for see if dict has a key
- Next by Date: Re: delete first line in a file
- Previous by thread: Re: delete first line in a file
- Next by thread: Re: delete first line in a file
- Index(es):
Relevant Pages
|