Help displaying data collected to user and not the console

Good afternoon,
I am brand new to Python, but have been able to put together a very simple gui, with 3 buttons. One collects and prints a single mysql table, one clears the table, one quits the app. Its reading wireless connection info internally that our WLC is logging.

My current thing is that it only prints data to the console in PyCharm (Im on a Mac/iPad) and never displays it to the window with my buttons. How can I print the data either to a pop up window, or the working app window to assist in troubleshooting connection issues with other team memebers. Below is what I have thus far.

<
import tkinter as tk
import mysql.connector

# creating root window
root = tk.Tk()

def run_command():
    mydb = mysql.connector.connect(
        host="xxx",
        user="xxxx",
        password="xxxx",
        auth_plugin='mysql_native_password',
        database="xxxxx"
    )
    mycursor = mydb.cursor()
    mycursor.execute("SELECT * FROM ACCOUNTING")
    myresult = mycursor.fetchall()
    # loop through the rows
    for row in myresult:
        print(row)
        print("\n")

def run_command2():
    mydb = mysql.connector.connect(
        host="xxxx",
        user="xxxx",
        password="xxxxx",
        auth_plugin='mysql_native_password',
        database="xxxx"
    )
    mycursor = mydb.cursor()
    mycursor.execute("TRUNCATE TABLE XXXXX")
    print("Table Cleared")

# root window title and dimension
root.title("Radiator Accounting Lookup and Flush")
root.geometry("1024x768")

# creating button
btn = tk.Button(root, text="Read Table", command=run_command)
btn.pack()
btn = tk.Button(root, text="Clear Table", command=run_command2)
btn.pack()
# Create a quit button
quit_button = tk.Button(root, text="Quit", command=root.quit)
quit_button.pack()
# running the main loop
root.mainloop()
</>

Hello,

you can append the following script into an existing button callback function, preferrably at the tail end of the existing callback function script… This will create a pop-up window. You will need to taylor the current default message to suit your application message requirements.

        root = Toplevel()
        root.title("Entry Warning")
        root.minsize(265, 50)

        text = tk.Label(root, fg = 'black', text = 'Message line 1 here '
                                                   '\nMessage line 2 here, etc.')
        text.config(font = ("Arial", 16))
        text.pack(padx = 40, pady = 30)

        button_boarder = tk.Frame(root, highlightbackground='blue', highlightthickness=2, bd=0)
        button = tk.Button(button_boarder, text = "OK", font=("Arial", 16), command = lambda : root.destroy())
        button.pack(pady=0)
        button_boarder.pack(padx = 1, pady = 10)

        root.wait_window()

Thank you. I will give that a try.

This is what I am trying to get to pop up in the popup window. Its the connection info from a mysql table after being formatted by the first function.

set “text” equal to that and it will be displayed in the pop-up window.

This has been figure out. Can be closed/deleted.