More details below:
1st line
2nd line
3rd line
4th line
...
Now want to insert a new line named zero line before 1st line. File looks like below:
zero line
1st line
2nd line
3rd line
4th line
...
I know sed command can do this work, but how to do it using python? Thanks
you can use
fileinput