#coding:utf-8
if __name__ == '__main__':
import string
fp = open('a.txt')
a = fp.read()
fp.close()
fp = open('b.txt')
b = fp.read()
fp.close()
fp = open('C.txt','w')
l = list(a + b)
l.sort()
s = ''
s = s.join(l)
fp.write(s)
fp.close()
python将两个文件合并。