PTT
Submit
Submit
选择语言
正體中文
简体中文
PTT
Python
[问题]想请教一个有关特定行数插入的问题
楼主:
alex711202
(David)
2019-03-22 17:39:45
问题如下,
如果有一个档案,内容为要插入特定字串的行数。
100
200
300
400
.
.
.etc
接下来要在另一个档案的特定行数插入特定字串。
xxxxxxxxxxxxxxxxxx '100
-> insert string
.
.
.
xxxxxxxxxxxxxxxxxx '200
-> insert string
.
.
.
xxxxxxxxxxxxxxxxxx '300
-> insert string
有高手可以分享解法吗,谢谢
作者:
froce
(froce)
2019-03-22 18:24:00
最笨的方法就读进list,改掉想要的元素,丢回原档
作者:
lemon651
(小明)
2019-03-22 20:22:00
读进list再插效率不好,不如开一个新的list全部扫一遍重插
继续阅读
[问题] import观念问题请教
yimean
[问题] 老程式打包移转问题
chang0206
Re: [问题] 出现unhashable type: 'list'该如何处理
as30385438
[问题] 正则表达分割字串(已解决)
silverair
[问题] 出现unhashable type: 'list'该如何处理
qzxwec789
[问题] 绳子减半
qokey0817
[问题]flask搭配uwsgi使用问题
michael3941
[问题] zip()在python2、python3官方文件问题
laughingman
[问题] matplotlib.pyplot关不起来
alen84204
flask_restful post file问题请教
buddy66
Links
booklink
Contact Us: admin [ a t ] ucptt.com