How do i create tabs dynamically in tkinter

Here i am designing a GUI using tkinter. I want to create tabs dynamically such that when i click each of the below function a new tab appears. Say for example i click show permissions , i want the persmissions to be shown on a new tab. i have tried everything till now and i am only able to do it manually using ttk.notebook, ie add tab1 , tab2, and so on to each and every function which is of no use and i want it to be dynamic such that whenever i click any option be it show permissions or show activity names and so on i want the output to be displayed on different tabs and the tabs must be show on the root window Can somebody please help me with this? In the code dis_file() is for disassembling an APK file and we are running the apktool command throught the subprocess module. perv_file() is for showing the permissions. Basically i am working on designing a GUI for disassembling an APK and the functions used in the code are also for the same.

    from tkinter import *
from tkinter.filedialog import askopenfile
from tkinter import font
from xml.dom.minidom import parseString
from tkinter import ttk
from tkinter.ttk import Notebook
import subprocess
import os
from tkinter import filedialog

root = Tk()
root.title('Text-Editor')
root.resizable(width=True, height=True)
root.geometry("1400x660")

text_list = []


notebook = Notebook()
notebook.pack(fill= "both", expand = True)


def add_tab(parent, contents, name):
    text = Text()
    text_list.append(text)
    text = text_list[len(text_list) - 1]
    parent.add(text, text=name)
    text.insert('end', contents)


def new_file():
    my_text.delete("1.0",END)
    root.title('New File - TextEditor')
    status_bar.config(text="New File        ")

def open_file():
    file = askopenfile(filetypes=[('Text file', '*.txt'),('All Files','*.*')])

    if file:
        add_tab(notebook, file.read(), file.name.split('/')[-1])



def save_as_file():
    text_file = filedialog.asksaveasfilename(defaultextension=".*",initialdir="/",title="Save file",filetypes=(("Text files",".txt"),("All files",".*.*")))
    if text_file:
        name = text_file
        name = name.replace("/","")
        root.title(f'{name} Saved1-TextEditor')

        text_file = open(text_file,'w')
        text_file.write(my_text.get(1.0, END))

        text_file.close()


def get_path(p):
    p = p.split(".")
    p.pop()
    return ''.join(p)


apk_path = filedialog.askopenfilename(initialdir="/",title = "Disassembling", filetypes=(("APK files","*.apk"),("All files","*.apk")))
gpath = get_path(apk_path) + "/AndroidManifest.xml"


def dis_file():
    
    subprocess.run(["apktool","d",apk_path])
    b = str(apkname(apk_path))
    command = "ls " + b + " >" + " a.txt"
    os.system(command)
    os.system("pwd > path.txt")
    file()
    

    



my_text = Text(root , font=("Arial", 16), selectbackground="yellow", selectforeground="black", undo=True)
my_text.pack(fill=BOTH , expand=1)


my_menu = Menu(root)
root.config(menu=my_menu)

file_menu = Menu(my_menu , tearoff = False)
my_menu.add_cascade(label="File" , menu = file_menu)
file_menu.add_command(label="New",command=new_file) 
file_menu.add_command(label="Open",command=open_file)
file_menu.add_command(label="Save")
file_menu.add_command(label="Save As",command=save_as_file)
file_menu.add_separator()
file_menu.add_command(label="Exit", command = root.quit)

edit_menu = Menu(my_menu , tearoff=False)
my_menu.add_cascade(label="Edit" , menu = edit_menu)
edit_menu.add_command(label="Cut")
edit_menu.add_command(label="Copy")
edit_menu.add_command(label="Paste")
edit_menu.add_command(label="Undo")
edit_menu.add_command(label="Redo")

dis_menu = Menu(my_menu , tearoff = False)
my_menu.add_cascade(label = "APK",menu=dis_menu)
dis_menu.add_command(label = "Disassemble", command = dis_file)
dis_menu.add_command(label = "Show Permissions", command = perm_file)
dis_menu.add_command(label = "Show Activity Names", command = act_file)
dis_menu.add_command(label = "Show Intents", command = inte_file)
dis_menu.add_command(label = "Show Intent Category", command = intent_cat)
dis_menu.add_command(label = "Show Services", command = serv_file)
dis_menu.add_command(label = "Show Providers", command = prov_file)
dis_menu.add_command(label = "Show Recievers", command = recv_file)
dis_menu.add_command(label = "Show App Info", command = app_file)

status_bar = Label(root, text='Ready        ', anchor = E)
status_bar.pack(fill=X ,side=BOTTOM , ipady =5)



root.mainloop()