python替换txt某一行_python 怎么替换文件的某一行的某一指定字段,如果文件很大呢?...

因为刚学python,所以有很多不懂的地方,希望大佬指教一下

比如现在,我有一个文件名叫test.txt,文件内容如下:

I am curious.

Why I am here?

There's some kind of magic effect my mind to look at the sky.

It is blue.

The sky is blue like a mirror, and I can look myself from it.

But the sky hasn't answer my question. Why I am here?

My dad said, everyone has the value to alive.

What is my value? I am standing with the sky.

Is that my value? The sky tell me to look myself,to understand myself,and I will find the answer.

Blue blue sky, with white cloud and warm wind.

Quiet between the earth and Zeus.

Everyone has to complete their mission from they reached the world until they leave.

Ya, this the value is.

然后我想把第7行的dad改为mom,该怎么办?

如果一个文件很大呢?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值