using threading and tkinter and binance api. Does not update message box in real time

Im trying to get the message box to update in real time, but it just displays the data when its first displayed and never updates after that

import pandas as pd
import time
from binance.client import Client
import tkinter as tk
import threading
import os

# Initialize the Binance client with your API keys
api_key = os.getenv('.....')  # Set your API key in your environment variables
api_secret = os.getenv('....')  # Set your API secret in your environment variables
client = Client(api_key, api_secret)

def fetch_doge_futures_data():
    """Fetch the last 500 DOGE futures trades from Binance."""
    trades = client.futures_recent_trades(symbol='DOGEUSDT', limit=500)
    data = {
        'trade_time': [trade['time'] for trade in trades],
        'price': [float(trade['price']) for trade in trades]
    }
    return pd.DataFrame(data)

def data_fetching_thread(root, trade_count_label, last_trade_label, last_trade_time_label):
    """Thread function to fetch data and update the GUI."""
    all_trades_df = pd.DataFrame(columns=['trade_time', 'price'])

    while True:
        new_data_df = fetch_doge_futures_data()
        all_trades_df = pd.concat([all_trades_df, new_data_df]).drop_duplicates(subset=['trade_time']).reset_index(drop=True)
        all_trades_df.sort_values(by='trade_time', inplace=True)

        if len(all_trades_df) > 1:
            all_trades_df['return'] = (all_trades_df['price'].diff() / all_trades_df['price']).shift(-1)

        # Filter the last trade of each second
        all_trades_df['trade_time'] = pd.to_datetime(all_trades_df['trade_time'], unit='ms')
        last_trade_per_second_df = all_trades_df.groupby(all_trades_df['trade_time'].dt.floor('S')).tail(1).reset_index(drop=True)
        
        if not last_trade_per_second_df.empty:
            last_trade = last_trade_per_second_df.iloc[-1]
            trade_count = len(all_trades_df.index)
            last_trade_price = last_trade['price']
            last_trade_time = last_trade['trade_time']

            # Update the GUI in the main thread
            root.after(0, lambda: update_gui(trade_count_label, last_trade_label, last_trade_time_label, trade_count, last_trade_price, last_trade_time))

        time.sleep(1)  # Sleep for 1 second before fetching new data

def update_gui(trade_count_label, last_trade_label, last_trade_time_label, trade_count, last_trade_price, last_trade_time):
    """Update the GUI with the latest data."""
    trade_count_label.config(text=f"Number of trades: {trade_count}")
    last_trade_label.config(text=f"Last trade: {last_trade_price}")
    last_trade_time_label.config(text=f"Last trade time: {last_trade_time}")

def main():
    """Set up the tkinter GUI and start the data fetching thread."""
    root = tk.Tk()
    root.title("DOGE Futures Data")

    # Create labels to display the number of trades and the last trade
    trade_count_label = tk.Label(root, text="Number of trades: 0", font=('Helvetica', 16))
    trade_count_label.pack(pady=10)

    last_trade_label = tk.Label(root, text="Last trade: None", font=('Helvetica', 16))
    last_trade_label.pack(pady=10)

    last_trade_time_label = tk.Label(root, text="Last trade time: None", font=('Helvetica', 16))
    last_trade_time_label.pack(pady=10)

    # Start the data fetching thread
    threading.Thread(target=data_fetching_thread, args=(root, trade_count_label, last_trade_label, last_trade_time_label), daemon=True).start()

    # Run the tkinter main loop
    root.mainloop()

if __name__ == "__main__":
    main()

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật