View unanswered posts | View active topics It is currently Fri Mar 29, 2024 5:45 am



Reply to topic  [ 4 posts ] 
 I made a Python script for making schedules 
Author Message
Handicapper

Joined: Sat Aug 25, 2018 7:30 am
Posts: 210
Post I made a Python script for making schedules
I was frustrated by the errors I was making in schedule and feature race files due to small things like not putting a comma where it was supposed to be, so I've made a script that will take your command line input and turn it into individual feature race files for the countries and then one schedule file. Fully formatted and I've even built in a duplicate checker that checks for duplicate names at the moment but I'll update to check for duplicate names at the same racecourse.

At the moment the script records all entered races to the SQLite database included, but doesn't interact with it in a way that means you can go back and print a race you've already entered. You also can't delete entries in the output files through the script, that has to be done by opening them up and doing it manually. I might add those things in the future if anyone expresses interest.

So how the script works (this assumes you've already installed Python 3+ and SQLite on your computer):

1. Download the files from the Github page to a folder on your computer.
2. Open up Command Prompt and navigate to the folder you've just downloaded to.
3. Type in the race details in this format (you have to enter your races in chronological order):

-f 1m4f -r COND -n "Jan Bris 1m4f Conditions" -p 25000 -a 3up -g T -m Jan -d 18 -i 'home' -t Brisbane -C mw -c 3

4. Press your enter key and the word "Success" should print in your Command Prompt.
5. If you open your schedule file and the featureRace file for the country, this is how it prints out:

1,18
Brisbane
Jan Bris 1m4f Conditions

<NAME>Jan Bris 1m4f Conditions<RACECOURSE>Brisbane:cc_flatTurf1
<MONTH>Jan<PRIZE>25000<EXTFIELDSPEC>home<DISTANCE>12.0<RACECATAG>CONDITIONS<AGE>3YOUP<CONDITIONS>maxwins=3

6. The last step is just moving the featureRace files to their country folders and renaming them to remove the prefix.

If anyone would like to download it, or check out the list of what all the -dashed letters mean, here's the link: https://github.com/twilightsophie/so7-schedule-tool


Wed Jan 15, 2020 11:47 am
Profile
Handicapper

Joined: Fri May 30, 2014 10:45 pm
Posts: 424
Post Re: I made a Python script for making schedules
Thanks mate. I will give it a try. I certainly share your pain about crashes with no explanation about why they crashed.


Sat Jan 18, 2020 10:32 am
Profile
Handicapper

Joined: Sat Aug 25, 2018 7:30 am
Posts: 210
Post Re: I made a Python script for making schedules
Thanks bobsworth :D I haven't written out all the choices in a separate Readme yet, but if you look in the script file while on Github you can see all the choices that I've defined for each argument. It might also not be set up to take half lengths of furlongs, I can't remember, so if that's the case, I can change it for you.

The biggest one I can think of is that for all the racecourse, they're called by their name in-game (like "Flemington") except for Ascot UK, which is "Ascot-uk" because there's two Ascots in the game.

If you don't want the SQLite backup of what you're typing, you can just use a hashtag # at the start of this line

sqlite3Entry()

and then it won't run.


I'll post here when I update it to fix anything.

ETA: While I've printed lots of test runs, I haven't actually put a whole schedule through to test yet. I'll make a test short schedule tonight and try it out, then update if I've messed it up.


Sun Jan 19, 2020 9:45 am
Profile
Handicapper

Joined: Sat Aug 25, 2018 7:30 am
Posts: 210
Post Re: I made a Python script for making schedules
So I've actually just found a way of making the program into a little app that lets you enter in races in text boxes rather than having to memorise the command line arguments, which will make it a lot more user-friendly to anyone who isn't quite sure about using Command Prompt. The app also shows you what the default choices are and only lets you choose from them, so that will help.

I'm going to revamp it to include the GUI option and at least come with install instructions for how to download the pre-requisites.


Mon Jan 20, 2020 2:41 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.