I have created 2 buttons that import Excel files using tkinter
library. I have also created function for each respective button so that when user clicks on the button the function will run. All the buttons are working fine but I wanted to know how to add progress bar to each button so that user can see when file is being imported and codes are executed. I have reviewed other similar posts but is not really helpful.
Here is my code:
from tkinter import *
from tkinter import filedialog
import pandas as pd
import numpy as np
from tkinter import ttk
def open_ec_file():
global ec_df
#pandas code goes here
def open_lms_file():
global lms_df
#pandas code goes here
window = Tk()
#Set title
window.title ('Report Generator')
# Set window size
window.geometry("800x500")
# add logo
window.iconbitmap('logo.ico')
Button(window, text = 'Import EC employee data', command = open_ec_file, bg = 'red', fg = 'white',
height = 2, font = 'none 14 bold') .grid(row = 2, sticky = E, padx = 6, pady = 8 )
Button(window, text = 'Import LMS data', command = open_lms_file, bg = 'red', fg = 'white',
font = 'none 14 bold') .grid(row = 4, column = 5, sticky = E, padx = 6, pady = 8 )