I have an assignment where I must write a script that runs before my main program and basically it checks if the main script has been modified by checking 2 other exact copies of the scripts that act as control variables to see if it's modified. The break is essentially me exiting this script and then going back to the first script ran which runs this check script and then the main script in sequential order assuming everything goes right. I am running Python 3.7. What keeps happening is that it runs the else clause I put in the bottom. main2 and main3 are exact copies of main. I also tried replacing == with is to not avail.
program = 25
while program == 25:
checkmain = open('main.py','r')
main2 = open('main2.py','r')
main3 = open('main3.py','r')
if main2 and main3 == checkmain:
checkmain.close()
main2.close()
main3.close()
break
else:
print("ERROR")
exit()