Dec-21-2019, 06:13 PM

Trying to write to a new text-file, formatted in a specific way:
The first, source, text-file is containing a list of nubmers in columns.
000123456
000123457
000123458
000123459
000123460
000123461
...........
I want to create a new list looking like this:
starts with parenthesis ("first row number" == "next row of number") and.
Like this:
(000123456 == 000123457) and
(000123458 == 000123459) and
(000123460 == 000123461).........
What is the easiest way to solve this? Started like this:
infile = open("regina.txt", "r+")
outfile = open("Regina_ID.txt", "w")
for line in infile:
infile = ( line + " == " )
outfile.write(infile)
outfile.close()
Thanks in advance!