Page 1 of 1

How to integrate code with buttons, txt and user input

Posted: Sun Apr 29, 2018 9:44 am
by Pleiades
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.

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)

Re: How to integrate code with buttons, txt and user input

Posted: Sun Apr 29, 2018 11:04 am
by eranif
There is no support for Python in CodeLite

Re: How to integrate code with buttons, txt and user input

Posted: Sun Apr 29, 2018 8:41 pm
by Pleiades
eranif wrote:There is no support for Python in CodeLite
Hi eranif,

Thanks for a quick reply, maybe you can help me with some c++ code which works with code lite for my project?

Re: How to integrate code with buttons, txt and user input

Posted: Mon Apr 30, 2018 1:03 am
by eranif
Sorry, this forum is for CodeLite issues only. If you seek C++ help, please search for C++ forums