How to integrate code with buttons, txt and user input
Posted: Sun Apr 29, 2018 9:44 am
Hi,
I'm building a program which predicts very large M Prime Numbers. I like the GUI CodeLite Ide. Anyway I wish to integrate this code with the gui. But I don't know how to make a button process the a number in the input window or txt file from Codelite. Here is the code I wrote which does modular math on Mersenne Numbers.
I'm building a program which predicts very large M Prime Numbers. I like the GUI CodeLite Ide. Anyway I wish to integrate this code with the gui. But I don't know how to make a button process the a number in the input window or txt file from Codelite. Here is the code I wrote which does modular math on Mersenne Numbers.
Code: Select all
KB = 1024
MB = 1024 * 1024
#Mod 12 for Mersenne check to confirm a 7
# except for numbers 2 & 3
def Mod_M_checker(file):
iszero = True
res = 0
for s in file:
n = int(s)
if iszero and n:
iszero = False
res = (res + n % 12)
if iszero:
return 0
else:
return res if res else 0
if __name__ == '__main__':
with open('127.txt', buffering=1*MB) as bigggg:
dr = Mod_M_checker(bigggg)
print(dr)