To remove some lines from a file

umut.tabak at student.kuleuven.be umut.tabak at student.kuleuven.be
Wed Oct 25 15:20:02 CEST 2006


Dear all,

I am quite new to python. I would like to remove two lines from a file.
The file starts with some comments, the comment sign is $. The file
structure is

$
$
$
$
$
$
$
.
.
.
.
$
line1
line 2
$
$
.
.
.
$
actual commands

I would like to delete those two lines at the very beginning of the
file between two comment blocks. I have read things about python but my
library knowledge is still weak. So could you please help me with this
code.

I would like to call this as

myscript targetfile

I have read sth about command line arguments. Perhaps I can cope with
that myself but help is also appreciated on that.

Best regards,




More information about the Python-list mailing list