Answers for "insert txt file data in the middle of the anohter txt file python"

1

python insert on a specific line from file

f = open("path_to_file", "r")
contents = f.readlines()
f.close()

contents.insert(index, value)

f = open("path_to_file", "w")
contents = "".join(contents)
f.write(contents)
f.close()
Posted by: Guest on August-23-2020

Code answers related to "insert txt file data in the middle of the anohter txt file python"

Python Answers by Framework

Browse Popular Code Answers by Language