No, you need to create one extra file
input_file = 'input_file.txt' # '/path/to/inputfile.txt' output_file = 'output_file.txt' # '/path/to/outputfile.txt' with open(input_file) as in_file, open(output_file, 'w') as out_file: for line in in_file: out_file.write(line) if line.strip() == '/##/': out_file.write('TEST INSERT OF NEW LINE\n')
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs