Aug-20-2022, 07:52 AM
These 2 php files are are < 8kb and they only have 5 lines which are not the same.
This takes zero.something seconds to complete. About as long as it takes to press enter.
Maybe buy a new computer? I recommend Ryzen R9 processors!
This takes zero.something seconds to complete. About as long as it takes to press enter.
Maybe buy a new computer? I recommend Ryzen R9 processors!
path1 = '/var/www/html/20BE1cw/20BE1sW3.html.php' path2 = '/var/www/html/20BE2cw/20BE2sW3.html.php' with open(path1) as f1, open(path2) as f2: lines1 = f1.readlines() lines2 = f2.readlines() # do this or you will get and index error when you get to the end of the shorter file. if len(lines1) == len(lines2): data1 = lines1 data2 = lines2 elif len(lines1) > len(lines2): data1 = lines1 data2 = lines2 else: data1 = lines2 data2 = lines1 diff = [] for d in range(len(data1)): if not data1[d] == data2[d]: diff.append(data2[d])
Output:>>> len(diff)
5