# Collection of code snippets by Arne Vajhøj 
# (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
fa = open('a.txt', 'r')
fb = open('b.txt', 'r')
fab = open('ab.txt', 'w')
while True:
    linea = fa.readline()
    if not linea: break
    fab.write(linea)
    lineb = fb.readline()
    if not lineb: break
    fab.write(lineb)
