Ejemplo n.º 1
0
def run():
    wantedfile = ''
    wantedfile = input('File > ')
    if wantedfile.endswith('.llangl'):
        try:
            file = open(wantedfile, 'r+', encoding='utf-8')
            file.write('')
            tlines = file.readlines()
            file.close()

            lines = []
            for i in tlines:
                lines.append(i.replace('\n', ''))

            ep.clear()

            for i in lines:
                try:
                    rl.readline(i, False)
                except:
                    print(
                        f"\n  >>> An error blocks the normal behaviour of the program <<<  \n  >>> running file: {wantedfile} <<<\n  >>> Line: {i+1} <<<\n"
                    )
        except:
            print('\nFile not found\n')
    else:
        print('\nFile Extension Error: the extension must be \'.llang\'')

    t = None
    while t == None:
        t = input('')
Ejemplo n.º 2
0
def run():
    wantedfile = ''
    wantedfile = input('File > ')
    if wantedfile.endswith('.llangl'):
        try:
            wantedfile = open(wantedfile, 'r+', encoding='utf-8')
            wantedfile.write('')
            tlines = wantedfile.readlines()
            wantedfile.close()

            lines = []
            for i in tlines:
                lines.append(i.replace('\n', ''))

            libs = [0, 0]

            islibs = 0

            for i in lines:
                if i == '#LIBINC;' and islibs == 0:
                    islibs = 1
                if i == '#INC Random;' and islibs == 1:
                    libs[0] = 1
                if i == '#INC Binary;' and islibs == 1:
                    libs[1] = 1
                if i == '#ENDINC;' and islibs == 1:
                    break

            rl.initlibs(libs)

            for i in lines:
                try:
                    rl.readline(i, False)
                except:
                    print(
                        '\n  >>> An error blocks the normal behaviour of the program <<<  \n'
                    )
                    print('\n >>>   ' + i + '   <<< \n')
        except:
            print('\nFile not found\n')
    else:
        print('\nFile Extension Error: the extension must be \'.llang\'')

    t = None
    while t == None:
        t = input('')
Ejemplo n.º 3
0
def run():
    ec = 'stop_shell'
    hlp = 'help_shell'
    status = True
    while status:
        sht = str(dt.today()) + ' :> Shell > '
        line = input(sht)
        if line == ec:
            status = False
            break
        if line == hlp:
            print(hlp_msg)
        if line != hlp:
            rl.readline(line, True)
    print('\n >>> Shell stopped <<< \n')

    t = None
    while t == None:
        t = input('')
Ejemplo n.º 4
0
def run(file):
    if file.endswith('.llangl'):
        try:
            wanted = open(file, 'r+', encoding='utf-8')
            wanted.write('')
            tlines = wanted.readlines()
            wanted.close()

            lines = []
            for i in tlines:
                lines.append(i.replace('\n', ''))

            for i in lines:
                try:
                    rl.readline(i, False)
                except:
                    print(
                        '\n  >>> An error blocks the normal behaviour of the program <<<  \n'
                    )
        except:
            print('\nFile not found\n')
    else:
        print('\nFile Extension Error: the extension must be \'.llang\'')