import os
import operator
import math
contents1=[]
contents2=[]
path1=r"D:\tr\data"
files_1=os.listdir(path1)
for file in files_1:
    pos=path1+"\\"+file
    content=[]
    with open(pos,'r',encoding='utf-8') as f:
        for line in f.readlines():
            content.append(eval(line))
    f.close()
    contents1.append(content)

path2=r"D:\tr\data2"
files_2=os.listdir(path2)
for file in files_2:
    pos=path2+"\\"+file
    content=[]
    with open(pos,'r',encoding='utf-8') as f:
        for line in f.readlines():
            content.append(eval(line))
    f.close()
    contents2.append(content)

sum0=[]
a=15000*48-4096*3
b=4096*3
for i in range(a):
    sum1 = 0
    sum2 = 0
    for j in range(b):
        sum1 += contents1[i][j]*contents2[i][j]-contents1[i][j]*contents2[i][j]
        sum2 += contents1[i][j]*contents2[i][j]+ contents1[i][j]*contents2[i][j]
    z=math.sqrt(sum1**2+sum2**2)

sum0.sort()