这样打开一个文本文件,并在文件中的特定位置(以字符计算)插入文本?
我正在思考...... ...
def insert_text(filename, text_to_insert, position):
with open(filename, "w") as file:
for line in file:
for ch in line:
if ch is position:
#insert text at position?