Go Back   OZmium Sports Betting and Horse Racing Forums > Public Forums > General Topics
User Name
Register FAQ Search Today's Posts Mark all topics as read

To advertise on these
forums, e-mail us.

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 8th October 2020, 11:43 AM
Shaun Shaun is offline
Join Date: Jan 1970
Location: Western Australia
Posts: 3,504
Default Python help using tkinter

This is my first attempt at a python app and can't find the answers i need so thought i would post here for some help.

This app will be a replacement for my Unitab prices excel sheet, so far i can import the venues and a bit of info for the day, i have tried a few different methods and the closes i can get is it prints the first venue info and stops, yet if you run this in your ide it prints all the info as i would like it.

The print statement doesn't need to be there.

from tkinter import * from tkcalendar import Calendar,DateEntry import json import requests app = Tk() app.title("Todays Races") app.geometry("1000x500") app.resizable(width=False, height=False) date_label = Label(app, text="Input Date", font=("bold", 14), pady=20) date_label.pack() cal = DateEntry(app,width=30,bg="darkblue",fg="white",date_pattern='yyyy-mm-dd',year=2020) cal.pack() date_btn = Button(app, text="Go", width=8, command=lambda: get_json()) date_btn.pack() def get_json(): state = "VIC" date = cal.get() url = "" + str(date) + "/meetings?jurisdiction=" + state data = requests.get(url) data1 = json.loads(data.content) Venues = data1["meetings"] for Venue in Venues: Rtype = Venue["raceType"] track = Venue["meetingName"] Rstate = Venue["location"] Wcondition = Venue["weatherCondition"] Tcondition = Venue["trackCondition"] states = ("VIC","NSW","QLD","SA","WA","TAS","ACT") if Rtype == "R" and Rstate in states: text = track + " " + Rstate + " " + Tcondition + " " + Wcondition print(text) app.mainloop()
One Drive

"If the corporates are treating you poorly , just go elsewhere."
"If they need you , they will soon find out."
"If you need them , you will soon find out."
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump

All times are GMT +10. The time now is 06:38 PM.

Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
2008 OZmium Pty. Ltd. All rights reserved . ACN 091184655