View Single Post
  #16  
Old 7th November 2020, 03:21 PM
Playlife Playlife is offline
Member
 
Join Date: Nov 2014
Posts: 33
Default

Quote:
Originally Posted by Shaun
Here is an almost finished project exe, it is missing a few things like race start time and results and maybe some instructions.

Just run it, select "Today" or "Tomorrow" highlight the "M-Code" for the meeting you want then put in a race number and press "Get Race"

It gives you some info in regards to ratings used on tab site, i also noted they show the same fixed prices for all the sites.

This is the first program i have written in like 30 years and the first in python, it may be a simple program to some but i am pretty pleased with my efforts as it gave me a better understanding of python i guess, the source code is not pretty and am sure it could be tidied up as there are a few errors.

the program is in my One Drive folder in my signature called "Tab_Prices" there is also a text doc with the python code in there.



EDIT, I do apologise, this only seems to work for VIC.


Hi Shaun, great job.

Unfortunately the move to this new API killed my excel/VBA work as well. I'm new to python, slowly learning the ropes.

It is as clunky as hell, and is manually coded, but using your script I have added the start time. Programmers will wince at how bad this is (sorry!). There's easier ways to do timezone conversions so I have read but cannot wrap my head around it yet.


**** inserted into # race info ****
race_StartTime = race1["raceStartTime"]
****
d1 = datetime.datetime.strptime(race_StartTime,"%Y-%m-%dT%H:%M:%S.%fZ")
new_format = "%H:%M"
HourOnly = "%H"
MinuteOnly = "%M"
Hour = str(int(d1.strftime(HourOnly))+11) # This is for Victoria AEDT (+11 hrs GMT)
Minute = d1.strftime(MinuteOnly)
race_StartTime = "Jump:" + Hour + ":" + Minute

raceStartTime = Label(inputFrame, text=str(race_StartTime), width=25, bg="darkblue", fg="white", font=("bold", 11), anchor=W)
raceStartTime.grid(row=0, column=20)

****
__________________
1977-1982
Gli Anni Della Febbre
Gilles Villeneuve
Reply With Quote