I also added this function which replaces the earlier packComparisonData().

def packTabs(tab_set, test_file):
    """Destructures a list of lines into a collection fo TabEntry objects,
     each of which containing a list of one or more subentries, and
     inserting the entries into a TabSet."""

    tab_titles = list()
    for line in test_file:
        tab_count, tab_title, button_name, json_request, expected_response = line.split('<->')
        tab_title = tab_title.strip()
        tab_set.add(tab_title,
                    button_name=button_name.strip(), 
                    json_request=json_request.strip(),
                    expected_response=expected_response.strip())
        if tab_title not in tab_titles:
            tab_titles.append(tab_title)
            tab_set.add(tab_title, tab=tk.Frame(tab_set))
            ttk.Label(tab_set.tabEntries[tab_title].tab, text=tab_title)            
        tab_set.pack(expand=1, fill="both")

This would be called like so:

    tabControl = TabSet(tabmain1, frmmain)
    packTabs(tabControl, varconfbook)

OK, this change may be a step too far, but I've simplified (or at least I see it as simpler) the banner section for the first tab. I've made a function that takes a dictionary of dictionaries with all the details for each of the labeled textboxes, and generates the frmbtn and frmbtnspec as well as the labels and textboxes.

def tabOneBanner(tabControl, tab_titles, banner_specs):
    frmbtnspecs = ttk.Frame(tabControl.tabEntries[tab_titles[0]].tab)
    frmbtnspecs.pack(side="top")
    for box in banner_specs.keys():
        banner_specs[box]["label"] = Label(frmbtnspecs, 
                                           width=banner_specs[box]["width"], 
                                           text="{0}:".format(box), 
                                           justify=RIGHT, 
                                           anchor="e").grid(row=0, 
                                                            column=banner_specs[box]["column"], 
                                                            sticky=W, 
                                                            pady=2)
        banner_specs[box]["textbox"] = Text(frmbtnspecs, height=1, width=35, relief=GROOVE, borderwidth=2).grid(row=0, 
                                                                                                                column=banner_specs[box]["column"]+1, 
                                                                                                                sticky=NW, 
                                                                                                                pady=2)

    frmbtn = ttk.Frame(tabControl.tabEntries[tab_titles[0]].tab)
    frmbtn.pack(side="top", expand=1, fill="both")
    return frmbtnspecs, frmbtn

The code to use this is:

    ################################################# tab1

    banner = {
        "Vendor": {"label": None, "textbox": None, "width": 8, "column": 0},
        "chargeBoxSerialNumber": {"label": None, "textbox": None, "width": 20, "column": 2},
        "Model": {"label": None, "textbox": None, "width": 8, "column": 4},
        "Firmware Version": {"label": None, "textbox": None, "width": 16, "column": 6}
    }
    frmbtnspecs, frmbtn = tabOneBanner(tabControl, tab_titles, banner)

The textboxes can then be accessed through the dictionary banner by giving it the name of the texbox and the "textbox" property. For example,

textboxvalue = banner["Vendor"]["textbox"]

I hope this actually makes sense for what you are trying to do.

I've fixed several issues with my earlier code, and have a version that behaves more or less as I think you want it to. Let me know if this is what you needed or not. I know I haven't suitably commented the code, so if you have any questions let me know.

TabSet.py

from tkinter import *
import tkinter as tk
from tkinter import ttk, Label


class TabSet(ttk.Notebook):
    def __init__(self, root, parent):
        super().__init__(root)
        self.root = root
        self.parent = parent
        self.tabEntries = dict()

    def add(self, title, **kwargs):
        if title not in self.tabEntries.keys():
            self.tabEntries[title] = TabEntry(title)
        if "tab" in kwargs.keys():
            if self.tabEntries[title].tab != None:
                raise TabSetDuplicateTabException(title)
            else:
                self.tabEntries[title].tab = kwargs["tab"]
                super().add(self.tabEntries[title].tab, text=title)
        if "subentry" in kwargs.keys():
            self.tabEntries[title].add(kwargs["subentry"])
        if "button_name" in kwargs.keys():
            self.tabEntries[title].subentries[kwargs["button_name"]] = TabSubentry(kwargs["button_name"], kwargs["json_request"], kwargs["expected_response"])


class TabEntry:
    def __init__(self, tab_title):
        self.tab_title = tab_title
        self.tab = None
        self.subentries = dict()

    def add(self, subentry):
        print(subentry.button_name)
        if subentry.button_name not in self.subentries.keys():
            print(subentry.button_name)
            self.subentries[subentry.button_name] = subentry
        else:
            raise TabEntryDuplicateSubentryException(self.tab_title, subentry.button_name)


class TabSubentry:
    def __init__(self, button_name, json_request, expected_response):
        self.button_name = button_name
        self.button = None
        self.json_request = json_request
        self.expected_response = expected_response


class TabSetDuplicateTabException(Exception):
    def __init__(self, title):
        self.title = title


class TabEntryDuplicateSubentryException(Exception):
    def __init__(self, title, button):
        self.title = title
        self.button = button


def packTabs(tab_set, test_file):
    """Destructures a list of lines into a collection fo TabEntry objects,
    each of which containing a list of one or more subentries, and
    inserting the entries into a TabSet.
    Returns a list of tab names."""
    tab_titles = list()
    for line in test_file:
        tab_count, tab_title, button_name, json_request, expected_response = line.split('<->')
        tab_title = tab_title.strip()
        tab_set.add(tab_title,
                    button_name=button_name.strip(),
                    json_request=json_request.strip(),
                    expected_response=expected_response.strip())
        if tab_title not in tab_titles:
            tab_titles.append(tab_title)
            tab_set.add(tab_title, tab=tk.Frame(tab_set))
            ttk.Label(tab_set.tabEntries[tab_title].tab, text=tab_title)            
    tab_set.pack(expand=1, fill="both")
    return tab_titles

if __name__ == "__main__":
    root = tk.Tk()
    root.title("Tab Widget")
    w, h = root.winfo_screenwidth(), root.winfo_screenheight()
    root.geometry("%dx%d+0+0" % (w, h))
    frame = Label(root, text='')
    frame.pack(side='top', fill='x', expand=False)    
    tabControl = TabSet(root, frame) 
    varconfbook = open("Confs/json_dumps.txt", "r").readlines()
    packTabs(tabControl, varconfbook)
    print(tabControl.tabEntries.keys())
    for key in tabControl.tabEntries.keys():
        print(tabControl.tabEntries[key].subentries.keys())
    tabControl.pack(expand=1, fill="both")
    root.mainloop()

JSON_Evaluator.py

import os
import time
from tkinter import *
import tkinter as tk
from tkinter import ttk, PhotoImage, LabelFrame, Text, GROOVE, Button, Label, scrolledtext
from tkinter.scrolledtext import ScrolledText
import requests
import json
from xpto.makeReport import savetoxls
from TabSet import *


def runpost(resp_json,reqtxt,tiporeq):
    try:
        getconfval = reqtxt.get(1.0, "end-1c")
        if len(getconfval)>1:
            resp_json.delete('1.0', END)
            resp_json.insert(tk.INSERT, str(url_endpoint+tiporeq)+", headers="+str(headers)+", data=json.dumps("+str(getconfval)+"), timeout="+str(timeoutvar)+"\n\n\n")
            reqjson = requests.request("POST", str(url_endpoint+tiporeq), headers=headers, data=json.dumps(getconfval), timeout=int(timeoutvar))
            statReason = ("Request:\n\n" + getconfval + "\n\nStatus:\n\n" + str(reqjson.status_code) + " - " + str(reqjson.reason) + "\n\nResponse:\n\n" + str(reqjson.text))
            resp_json.insert(tk.INSERT, statReason)

    except Exception as e:
        from OCPP.main import log_error
        resp_json.insert(tk.INSERT, "\n\n"+str(e)+"\n\n")
        log_error(e, "runpost")


    def ChangConfWI(tipreq,reqtxt,lblexp):
    #try:
        reqtxt.delete('1.0', END)
        lblexp.delete('1.0', END)
        reqtxt.insert(tk.INSERT, lstjsonreq[tipreq])
        lblexp.insert(tk.INSERT, str(lstexpectresq[tipreq]))
    #except Exception as e:
     #   from OCPP.main import log_error
      #  log_error(e, "ChangConfWI")

def tabZeroBanner(tabControl, tab_title, banner_specs):
    frmbtnspecs = ttk.Frame(tabControl.tabEntries[tab_title].tab)
    frmbtnspecs.pack(side="top")
    for box in banner_specs.keys():
        banner_specs[box]["label"] = Label(frmbtnspecs, 
                                           width=banner_specs[box]["width"], 
                                           text="{0}:".format(box), 
                                           justify=RIGHT, 
                                           anchor="e").grid(row=0, 
                                                            column=banner_specs[box]["column"], 
                                                            sticky=W, 
                                                            pady=2)
        banner_specs[box]["textbox"] = Text(frmbtnspecs, height=1, width=35, relief=GROOVE, borderwidth=2).grid(row=0, 
                                                                                                                column=banner_specs[box]["column"]+1, 
                                                                                                                sticky=NW, 
                                                                                                                pady=2)

    frmbtn = ttk.Frame(tabControl.tabEntries[tab_title].tab)
    frmbtn.pack(side="top", expand=1, fill="both")
    return frmbtnspecs, frmbtn

###########################################nova janela####################################

def gera_forms(parent, get_inp_cond_id, get_inp_cond_endpoint):
    parent.pack_forget()

    nome_endpoint, timeoutvar, url_endpoint = get_inp_cond_endpoint.split('<:>')
    nome_endpoint = nome_endpoint.replace('  ', '').strip()
    url_endpoint = url_endpoint.replace(' ', '').strip()
    timeoutvar = timeoutvar.replace(' ', '').strip()

    photoRun = PhotoImage(file=r'img/run.png')
    photoOK = PhotoImage(file=r'img/ok.png')
    photoNot = PhotoImage(file=r'img/notok.png')

    headers = {'Content-Type': 'application/json', 'chargingstation':'stat1'}

    tiporeq = ""
    payload = json.dumps({})
    expResp = ""

    lsttiporeq = []
    lsttitreq = []
    lstjsonreq = []
    lstexpectresq = []

    varconfbook = open("Confs/json_dumps.txt", "r").readlines()
    tabControl = TabSet(tabmain1, frmmain)
    tab_titles = packTabs(tabControl, varconfbook)
    tabControl.pack(expand=1, fill="both")

    def makesubmenu(tab_title):
        tab = tabControl.tabEntries[tab_title].tab
        frm_json_case_button = ttk.Frame(tab)
        frm_json_case_button.grid(column=0, row=0, rowspan=99)

        frm_txt_json_case = ttk.Frame(tab)
        frm_txt_json_case.grid(column=1, row=0)

        url_show=ttk.Label(frm_txt_json_case, text=nome_endpoint + "  @  " + str(url_endpoint + tab_title) + "  @  " + get_inp_cond_id)
        url_show.grid(column=1, row=0, columnspan=99, padx=10, pady=10)

        ttk.Label(frm_txt_json_case, text="Request:").grid(column=2, row=1, padx=10, pady=10)
        reqst_input = ScrolledText(frm_txt_json_case, width=75, height=10, wrap=tk.WORD)
        reqst_input.grid(column=2, row=2, padx=10, pady=10, ipady=35)

        ttk.Label(frm_txt_json_case, text="Expected Response:").grid(column=2, row=3, rowspan=1, padx=10, pady=10)
        lblexpect = ScrolledText(frm_txt_json_case, width=75, height=10, wrap=tk.WORD)
        lblexpect.grid(column=2, row=4, padx=10, pady=10, ipady=15)

        resp_json_input = ScrolledText(frm_txt_json_case, width=75, height=10, wrap=tk.WORD)
        resp_json_input.grid(column=4, row=2, padx=10, pady=10, ipady=35)

        ttk.Button(frm_txt_json_case, text="Run", image=photoRun,command=lambda resp_json=resp_json_input, reqtxt=reqst_input, tiporeq=tab_title: runpost(resp_json, reqtxt, tiporeq)).grid(column=3, row=2, padx=10, pady=10, ipady=65)
        ttk.Label(frm_txt_json_case, text="Response:").grid(column=4, row=1, padx=10, pady=10)
        ttk.Label(frm_txt_json_case, text="Response / OBS:").grid(column=3, row=3, columnspan=5, padx=10, pady=10)
        resp_kiblog = ScrolledText(frm_txt_json_case, width=95, height=10)
        resp_kiblog.grid(column=3, row=4, padx=10, columnspan=5, rowspan=10, pady=10, ipady=120)

        frm_but_oknot = ttk.Frame(frm_txt_json_case)
        frm_but_oknot.grid(column=2, row=5, padx=1, pady=1)

        ttk.Button(frm_but_oknot, width="15", text="OK", image=photoOK, command=lambda: savetoxls(jsonresponse)).grid(column=0, row=0,padx=1, pady=15)
        ttk.Button(frm_but_oknot, width="15", text="Not Ok", image=photoNot).grid(column=1, row=0, padx=1, pady=15)

        # generate the column 0 buttons
        for i, button_name in enumerate(tabControl.tabEntries[tab_title].subentries.keys()):
            button = ttk.Button(frm_json_case_button,
                                width="20",
                                text=button_name,
                                command=lambda lblexp=lblexpect, reqtxt=reqst_input, cont=i: ChangConfWI(int(cont),reqtxt,lblexp))
            button.grid(column=0, row=i, padx=10, pady=10)
            tabControl.tabEntries[tab_title].subentries[button_name].button = button


        return reqst_input, lblexpect, resp_json_input,resp_kiblog

    ################################################# tab 0
    banner = {
        "Vendor": {"label": None, "textbox": None, "width": 8, "column": 0},
        "chargeBoxSerialNumber": {"label": None, "textbox": None, "width": 20, "column": 2},
        "Model": {"label": None, "textbox": None, "width": 8, "column": 4},
        "Firmware Version": {"label": None, "textbox": None, "width": 16, "column": 6}
    }

    frmbtnspecs, frmbtn = tabZeroBanner(tabControl, tab_titles[0], banner)


    var_expect_result = open("Confs/expectresult.txt", "r").readlines()
    for coll, line in enumerate(var_expect_result):
            x, y, y1 ,y2 ,y3 ,y4 ,y5 = line.split('<->')
            y_respexpt=(y+"\n\n"+y1+"\n\n"+y2+"\n\n"+y3+"\n\n"+y4+"\n\n"+y5).replace(' ', '').strip()
            lbl = Label(frmbtn, text=x.replace(' ', '').strip()).grid(column=coll, row=0, padx=10, pady=10)
            lbl = Label(frmbtn, text="Response / OBS:").grid(column=coll, row=1, padx=10, pady=10)
            kiblogbn = ScrolledText(frmbtn, width=25, height=20)
            kiblogbn.grid(column=coll, row=2, padx=10, pady=10, ipady=25)
            ttk.Button(frmbtn, width="5", text="OK", image=photoOK).grid(column=coll, row=3, padx=1, pady=1)
            ttk.Button(frmbtn, width="5", text="Not Ok", image=photoNot).grid(column=coll, row=4, padx=1, pady=1)
            lblspec = Label(frmbtn, text=y_respexpt, justify='left', anchor=N)
            lblspec.grid(column=coll, row=5, rowspan=55, sticky=N, padx=20, pady=20)

    for i in range(1, len(tab_titles)):
        makesubmenu(tab_titles[i])

###########################################FIM nova janela####################################

if __name__ == "__main__":
    tabmain1 = Tk()
    w, h = tabmain1.winfo_screenwidth(), tabmain1.winfo_screenheight()
    tabmain1.geometry("%dx%d+0+0" % (w, h))

    frmmain = Label(tabmain1, text='')
    frmmain.pack(side='top', fill='x', expand=False)

    gera_forms(frmmain, "stat1","nome_end<:>30<:>http://something.com/?")

    tabmain1.mainloop()
commented: wowow, that is alot to take in. thanks, let me see if i can make something from here :) +1

got the same error as before

 File "/Users/ricardosimoes/PycharmProjects/pythonProject/OCP/testes/tabset.py", line 69, in packTabs
    tab_count, tab_title, button_name, json_request, expected_response = line.split('<->')
ValueError: not enough values to unpack (expected 5, got 1)

Could you post the current version of Confs/json_dumps.txt, please?

made some changes but its still 5 slots

ChangeConfiguration<->Configuration <-> Change ID <-> {"key": "Identity","value": "00006"}<->Reboot Response
ClearCache<->ClearCache <-> Without Inputs <-> {}<-> Response retrieving all conf
ChangeAvailability<-> Availability <-> Without Inputs <-> {}<->CALLERROR Response

OK, this is odd. When I use the new Confs/json_dumps.txt file, it runs fine on my end. I don't know why it isn't working for you. Have you checked to make sure there isn't a stray newline or other whitespace at the start or end of the file?

Try adding a print(line, end='') to the for: loop in packTabs(), like so:

    for line in test_file:
        print(line, end='')
        tab_count, tab_title, button_name, json_request, expected_response = line.split('<->')

This should tell you if it is finding a line which isn't expected.

this is way outer my league... too complicated for now, thank you so much for all the time you spend. ill come back to this when im a little more advance in python.

ill keep it like this

but maybe you can help me this, im sure its easier.... i whant to change the background color of the tab that have obrigatorio in tipo.

 x = 0
    for nome,tipo in zip(lst_menu, lst_tipo):
        if "Obrigatorio" in tipo:
            bgcol = "red"
        else:
            bgcol = "green"

        if x == 1:
            tab1 = ttk.Frame(tabControl)
            tabControl.add(tab1, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab1)

        elif x == 2:
            tab2 = ttk.Frame(tabControl)
            tabControl.add(tab2, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab2)

        elif x == 3:
            tab3 = ttk.Frame(tabControl)
            tabControl.add(tab3, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab3)

        elif x == 4:
            tab4 = ttk.Frame(tabControl)
            tabControl.add(tab4, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab4)

        elif x == 5:
            tab5 = ttk.Frame(tabControl)
            tabControl.add(tab5, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab5)

        elif x == 6:
            tab6 = ttk.Frame(tabControl)
            tabControl.add(tab6, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab6)

        if x == 7:
            tab7 = ttk.Frame(tabControl)
            tabControl.add(tab7, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab7)

        elif x == 8:
            tab8 = ttk.Frame(tabControl)
            tabControl.add(tab8, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab8)

        elif x == 9:
            tab9 = ttk.Frame(tabControl)
            tabControl.add(tab9, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab9)

        elif x == 10:
            tab10 = ttk.Frame(tabControl)
            tabControl.add(tab10, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab10)

        elif x == 11:
            tab11 = ttk.Frame(tabControl)
            tabControl.add(tab11, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab11)

        elif x == 12:
            tab12 = ttk.Frame(tabControl)
            tabControl.add(tab12, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab12)

        elif x == 13:
            tab13 = ttk.Frame(tabControl)
            tabControl.add(tab13, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab13)

        elif x > 13:
            messagebox.showinfo("Menu Teste", "Nao é possivel adicionar mais tabuladores.\n\n o numero maximo de tabuladores permitidos é 13, \n\n por favor reveja o seu ficheiro de configuracao (json_dumps.txt)")
            tabControl.update()
            break
        x += 1

hope this could work

    style = ttk.Style()
    style.theme_create("stl_obrigator", parent="alt", settings={
        "TNotebook": {"configure": {"tabmargins": [2, 5, 2, 0]}},
        "TNotebook.Tab": {
            "configure": {"padding": [5, 1], "background": "#fd6262"},
            "map": {"background": [("selected", "#fd2b2b")],
                    "expand": [("selected", [1, 1, 1, 0])]}}})

    style.theme_create("stl_facult", parent="alt", settings={
        "TNotebook": {"configure": {"tabmargins": [2, 5, 2, 0]}},
        "TNotebook.Tab": {
            "configure": {"padding": [5, 1], "background": "#62fd72"},
            "map": {"background": [("selected", "#02d417")],
                    "expand": [("selected", [1, 1, 1, 0])]}}})

    style.theme_use("stl_obrigator")
    tab0 = ttk.Frame(tabControl)
    tabControl.add(tab0, text="Messages")

    lst_menu= []
    lst_tipo=[]
    for line in varconfbook:
        if len(line) > 1:
            aaaaaa, tipo,nome,bbbbb,ccccc,ddddddd = line.split('<->')
            if nome not in lst_menu:
                lst_menu.append(nome)
                lst_tipo.append(tipo)


    x = 0
    for nome,tipo in zip(lst_menu, lst_tipo):
        if "Obrigatorio" in tipo:
            style.theme_use("stl_obrigator")
        else:
            style.theme_use("stl_facult")

Does this do anything, and if so, what? Do you get any errors when you try it?

To help more, I'd have to see how this fits into the rest of the program as it is now.

it creates the tabs based on the txt

tabControl = ttk.Notebook(tabmain1)



    style = ttk.Style()
    style.theme_create("stl_obrigator", parent="alt", settings={
        "TNotebook": {"configure": {"tabmargins": [2, 5, 2, 0]}},
        "TNotebook.Tab": {
            "configure": {"padding": [5, 1], "background": "#fd6262"},
            "map": {"background": [("selected", "#fd2b2b")],
                    "expand": [("selected", [1, 1, 1, 0])]}}})

    style.theme_create("stl_facult", parent="alt", settings={
        "TNotebook": {"configure": {"tabmargins": [2, 5, 2, 0]}},
        "TNotebook.Tab": {
            "configure": {"background": "#62fd72"},
            "map": {"background": [("selected", "#02d417")],
                    "expand": [("selected", [1, 1, 1, 0])]}}})

    style.theme_use("stl_obrigator")
    tab0 = ttk.Frame(tabControl)
    tabControl.add(tab0, text="Messages")

    lst_menu= []
    lst_tipo=[]
    for line in varconfbook:
        if len(line) > 1:
            aaaaaa, tipo,nome,bbbbb,ccccc,ddddddd = line.split('<->')
            if nome not in lst_menu:
                lst_menu.append(nome)
                lst_tipo.append(tipo)


    x = 0
    for nome,tipo in zip(lst_menu, lst_tipo):
        if "Obrigatorio" in tipo:
            style.theme_use("stl_obrigator")
        else:
            style.theme_use("stl_facult")

        if x == 1:
            tab1 = ttk.Frame(tabControl)
            tabControl.add(tab1, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab1)

        elif x == 2:
            tab2 = ttk.Frame(tabControl)
            tabControl.add(tab2, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab2)

        elif x == 3:
            tab3 = ttk.Frame(tabControl)
            tabControl.add(tab3, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab3)

        elif x == 4:
            tab4 = ttk.Frame(tabControl)
            tabControl.add(tab4, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab4)

        elif x == 5:
            tab5 = ttk.Frame(tabControl)
            tabControl.add(tab5, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab5)

        elif x == 6:
            tab6 = ttk.Frame(tabControl)
            tabControl.add(tab6, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab6)

        if x == 7:
            tab7 = ttk.Frame(tabControl)
            tabControl.add(tab7, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab7)

        elif x == 8:
            tab8 = ttk.Frame(tabControl)
            tabControl.add(tab8, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab8)

        elif x == 9:
            tab9 = ttk.Frame(tabControl)
            tabControl.add(tab9, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab9)

        elif x == 10:
            tab10 = ttk.Frame(tabControl)
            tabControl.add(tab10, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab10)

        elif x == 11:
            tab11 = ttk.Frame(tabControl)
            tabControl.add(tab11, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab11)

        elif x == 12:
            tab12 = ttk.Frame(tabControl)
            tabControl.add(tab12, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab12)

        elif x == 13:
            tab13 = ttk.Frame(tabControl)
            tabControl.add(tab13, text=nome.strip())
            tabControl.pack(expand=1, fill="both")
            makesubmenu(nome.strip(), tab13)

        elif x > 13:
            messagebox.showinfo("Menu Testes OCPP", "Nao é possivel adicionar mais tabuladores.\n\n o numero maximo de tabuladores permitidos é 13, \n\n por favor reveja o seu ficheiro de configuracao (json_dumps.txt)")
            tabControl.update()
            break
        x += 1

Cuuld you please give me the current version of json_dumps.txt? It looks as if you've changed it somewhat.

I know I've harped on this a lot already, but this is another place where using a VCS and a public offsite repository would make things much easier for both of us.

Also, before I dive into this to see what I find, I want to mention a few problems I see with the code as it is.

The first is the variable x, and specifically, the way you are explicitly incrementing it. Now, ordinarily, a for: loop in Python, unlike one in (for example) C, does not have an explicit loop iteration index - you know, the 1,2,3,...n counter for the elements being iterated over. However, since there are times when you do actually need such an index, Python has a special function two special functions, range() and enumerate(). The function range() takes two values and returns a list counting from the first vlaue to the second. Thus, you could write:

for i in range(0, 5):
    print(i)

which produces

0
1
2
3
4

The enumerate() function, by contrast, takes the collection being iterated over and returns two items, and index followed by the current element. This means that instead of this:

 i = 0
for element in myList:
     print("{0}: {1}".format(i, element)
     i += 1

you could write

 for i, element in enumerate(myList):
     print("{0}: {1}".format(i, element)

The second, which I think is more serious, is that you are using a for: loop to iterate through several items, but then using an if/elif/else to pick out the individual elements. This is what some people call the "loop-switch sequence" anti-pattern, as the for: and the conditionals are completely redundant - you only need to do each of the parts which are inside the ifs. There is no useful need to iterate over them if you are going to then pick out which one it is you want to work on each time.

I hope this doesn't sound overly harsh, but I thought you'd want the advice in order to improve your programming habits. I'll look more into the actual code itself shortly.

This may be presumptuous of me, but would you like me to set up a public repo for your code on my Github account? That may make sharing the code and data files a lot easier for both of us.

commented: i never used git on a developer base :( wouldnt know how to use it +2

i never used git on a developer base :( wouldnt know how to use it

OK, fair enough. It wouldn't necessarily have to be Git, but if you don't know how to use any VCS, then I can see that it wouldn't be much help for you right now.

I do recommend learning how to use a VCS, with Git being the one which would probably get you farthest; it is well worth the trouble, as it has a lot of advantages (having an audit trail of your changes for the purpose of tracking bugs, being able to backtrack changes, being able to set up branches for testing out new idea that you aren't sure will work out, having an extra copy on a different computer to act as an extra backup, being able to collaborate with a different developer anywhere in the world, etc.). But that's up to you.

commented: got git, how do i add you? +2

The link doesn't work. By going to GitHub, I can see your account, but it isn't showing any public repositories.

This documentation page seems to be the information you are looking for. My own GitHub account is here.

commented: done +2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.