Smartgambler
Pro-Punter

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

To advertise on these
forums, e-mail us.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 27th March 2012, 02:39 PM
Toil Toil is offline
Member
 
Join Date: Nov 2010
Posts: 89
Default Python: get_rands.zip from jazzy

Quote:
Originally Posted by jazzy
'Cause I'm such a nice guy , here's a quick and dirty Python script I wrote a while ago for a mate of mine... Dunno if he still uses it...

It gets all the worksheets for the day and writes the favourites to a spreadsheet. Note, it is a quick and dirty script, there is no error checking, and if it has a problem with something it raises an exception and closes (default Python behaviour)

If you want to try it out you will need to install Python - get it from http://www.python.org - get 2.7 not 3.x - it is not compatible and pywin32 (for the excel stuff) from http://sourceforge.net/projects/pyw...win32/Build216/ - select the right version to match the version of Python you've got.

Anyway, it shows what can be done.


Does anyone know if this get_rands script from jazzy still works or am I not using python properly?
Reply With Quote
  #2  
Old 27th March 2012, 03:04 PM
Raven Raven is offline
Member
 
Join Date: Jun 2006
Posts: 225
Default

It worked the last time i used it Toil, in early Jan

you need those downloads he suggests
Reply With Quote
  #3  
Old 27th March 2012, 03:24 PM
The Ocho The Ocho is offline
Member
 
Join Date: Aug 2010
Posts: 1,037
Default

Is your wife a..."goer"... eh? Know what I mean? Know what I mean? Nudge nudge. Wink wink! Know what I mean? Say no more...Know what I mean?

A nod's as good as a wink to a blind bat, eh?.

The python were pretty funny.

__________________
Never give up on a dream just because of the time it will take to accomplish it. The time will pass anyway.”

― Earl Nightingale

Last edited by The Ocho : 27th March 2012 at 03:28 PM.
Reply With Quote
  #4  
Old 27th March 2012, 09:15 PM
Toil Toil is offline
Member
 
Join Date: Nov 2010
Posts: 89
Default

Thanks Raven, I'll play around with it a bit more.
Reply With Quote
  #5  
Old 28th March 2012, 02:00 PM
jazzy jazzy is offline
Member
 
Join Date: Nov 2010
Posts: 49
Default

G'day Toil,

I've since moved on to Python 3 so although installed, Python27 isn't on my system's path anymore. I just tested the script, and it got all the pages OK, but fell over when creating the excel sheet. Something to do with the path. If you really want me to, I'll have a go at fixing it...

What happens when you run it?
Reply With Quote
  #6  
Old 28th March 2012, 04:02 PM
Toil Toil is offline
Member
 
Join Date: Nov 2010
Posts: 89
Default

Hi Jazzy, thanks for replying.

I'm using PythonWin 2.7.2(pywin32 build 217)

I click open file and open get_rands and then all I see is the code.

import urllib2, re, datetime, win32com.client, sys, os.path, decimal


usragent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5; .NET CLR 2.0.50727; ffco7) Gecko/2008120122 Firefox/3.0.5"
xlpath = "%s\\%s" % (os.path.dirname(sys.argv[0]) , "rands.xlsx")



tooday = datetime.date.today()
tomorrow = tooday+datetime.timedelta(days=1)






#href="meeting.asp?meeting=13493"> Cowra
match_mtgs = re.compile("href=\"meeting.asp\?meeting=(\d+)\"> (.*?)")
match_races = re.compile(" #>Race 1
13:15 (local)
13:15
  #7  
Old 28th March 2012, 08:32 PM
jazzy jazzy is offline
Member
 
Join Date: Nov 2010
Posts: 49
Default

OK, sounds like you are running IDLE (Python GUI)?

I normally just run my scripts from a command prompt...

Just tried running the scrpt from IDLE and it works - the path problem disappears

So... from IDLE - open the file, then hit Run Module from the Run menu (or F5)

Bear in mind, it is/was a QUICK AND DIRTY script for a specific job, so it only takes some of the data. I only really put it up to show what was possible using Python.

Cheers
Reply With Quote
  #8  
Old 28th March 2012, 10:23 PM
Toil Toil is offline
Member
 
Join Date: Nov 2010
Posts: 89
Default

Thanks jazzy, that worked, thats pretty cool what it did.

I would be interested later to maybe pay someone to do me some scripts.

Like for instance would it be possible get python to get these panels from R&S: Rating, Neurals, Times, Switches, Trn, $, ST/LT, and Crs and import them to excel side by side all the way along the sheet with all the TAB numbers and each runners info on the same line as below so after the CLS LS column you would see the TAB numbers again from the next chart and what ever else is in that chart?

TAB HORSE WT TS +- BP TS LS DIST LS +- CLS LS
1 Finding Water 58.0 2 14 5 1700m -25 MDN
2 Ihts Riveting 58.0 0 4 5 1675m 0 MDN
3 Bar Lover 58.0 0 15 1 1400m 275 MDN
4 Flip Mccool 58.0 3 12 2 2013m -338 MDN
5 Falcon Strike 58.0 2 6 6 1300m 375 MDN
6 Greek God 57.5 0 18 14 1400m 275 MDN

Last edited by Toil : 28th March 2012 at 10:28 PM.
Reply With Quote
  #9  
Old 29th March 2012, 11:11 AM
jazzy jazzy is offline
Member
 
Join Date: Nov 2010
Posts: 49
Default

Yep. Sounds doable.
Reply With Quote
Reply


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 01:02 PM.


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