I am creating a python program for a competition displaying the price of shares and the share prices are meant to be updated every minute. I have an excel sheet through which I need to sync prices every minute. To achieve this, I have used openpyxl external library.
I have created the core program successfully but I am badly stuck when it is coming to implementing it on GUI. I don't have any idea how to create a tkinter GUI which updates price at the end of every while loop iteration,
Here's the code till now (I know it can be better but I have to deliver it tomorrow and it's only one-time thing so it won't matter) -
UPDATE There is no need of user interacting with software. I only require formatting for sleek looks.
#GUI
app = Tk()
app.title("Trading Times 2016")
app.geometry('768x720')
#Execution
Raw = 3
timer = 1
int(Raw)
while Raw != 141:
os.system('CLS')
#timer
print("Time - %i" %timer)
timer += 1
#Currency
print("\n")
print("Dollar -", currency["C%d" %Raw].value)
print("Pound -", currency["E%d" %Raw].value)
print("Euro -", currency["G%d" %Raw].value)
print("Yuan -", currency["I%d" %Raw].value)
#Commodity
print("\n")
print("Gold per 100gm -", commodity["C%d" %Raw].value)
print("Wheat per Quintal -", commodity["E%d" %Raw].value)
print("Silver per Kg -", commodity["G%d" %Raw].value)
print("Crude per Barrel -", commodity["I%d" %Raw].value)
#Bonds
print("\n")
print("Bonds -", bonds["C%i" %Raw].value)
percent = bonds["E%i" %Raw].value
int(percent)
print("RBI Bonds Yield(In Per Cent) - %i" %percent)
#ETF's
print("\n")
print("Small Cap Index -", etf["B%d" %Raw].value)
print("Junior BEES -", etf["C%d" %Raw].value)
print("Bank BEES -", etf["D%d" %Raw].value)
print("PSUBNK BEES -", etf["E%d" %Raw].value)
print("CPSTTEF -", etf["F%d" %Raw].value)
print("Infra BEES -", etf["G%d" %Raw].value)
print("Nifty BEES -", etf["H%d" %Raw].value)
print("SENSEX -", etf["I%d" %Raw].value)
#Mutual Funds
print("\n")
print("ABC -", mutual_funds["B%d" %Raw].value)
print("DEF -", mutual_funds["C%d" %Raw].value)
print("TNC -", mutual_funds["D%d" %Raw].value)
print("KFJ -", mutual_funds["E%d" %Raw].value)
print("YWU -", mutual_funds["F%d" %Raw].value)
print("QNV -", mutual_funds["G%d" %Raw].value)
print("NBV -", mutual_funds["H%d" %Raw].value)
print("KAS -", mutual_funds["I%d" %Raw].value)
print("AYD -", mutual_funds["J%d" %Raw].value)
print("IT FUND -", mutual_funds["K%d" %Raw].value)
print("PHARMA -", mutual_funds["L%d" %Raw].value)
print("FMCG -", mutual_funds["M%d" %Raw].value)
#Shift Raw
Raw += 1
time.sleep(60)
app.mainloop()
Can anyone please help me in implement a GUI which can update itself every minute. Thanks