Remove this ad
avatar

factotum

rookie botter

Posts: 18 Member Since:April 21, 2013

#21 [url]

June 25, 2013 17:17:57

>>> g=int(input("Enter number here: "))
Enter number here: 43
>>> g
43

Understand now :)

Quote    Reply   
Remove this ad
avatar

birchy

Betfair Elite

Posts: 593 Member Since:May 11, 2008

#22 [url]

June 25, 2013 20:10:41



Glad you're working at it rather than just giving up. There are a few data types, the main ones being strings, integers and floats. Beyond that, you'll need knowledge of list and dictionary type objects and how to loop through them using "For x in y" type statements. Then understand Class objects and you're pretty much ready to code your first bot. Finish the tutorials though, it will teach you the basics. From there on, you can learn by experience.

Just a word of advice regarding Python versions...I only develop in Python "stable" releases as packaged with Debian Linux operating system, which is currently version 2.7. My code may require a little work to get it running on Python 3. Although there IS a Python 3 version of the library on my website, it as not been production tested.

www.bespokebots.com

"This time next year Rodney, we'll be millionaires!"

Quote    Reply   
avatar

otter

rookie botter

Posts: 8 Member Since:October 3, 2009

#23 [url]

June 26, 2013 06:44:41




Factotum:

This is almost certainly a Python 2.x versus Python 3.x difference.

In Python 2.x, 'input()' was a rather dangerous function, and 'raw_input()' was the safe version, that always returned a string.

In Python 3.x, they dropped the dangerous version, and renamed the safe version to 'input()'.

If you are only fetching numbers, try these:

In Python 2.x:  g = int(raw_input("Enter a number: "))
In Python 3.x:  g = int(input("Enter a number: "))

These may raise exceptions if the data entered is not a number.

Avoid using 'input()' on Python 2.x, and equivalently 'eval()' on either version, until you fully understand how they can be used by others to run arbitrary code, or can do damage if the wrong information is typed in. You probably will never need them.


Quote    Reply   
avatar

factotum

rookie botter

Posts: 18 Member Since:April 21, 2013

#24 [url]

June 26, 2013 07:52:59

Thanks birchy and otter, I am really enjoying learning python. BTW do you guys compile to exe in preference to .py files?
I will follow your suggestions and pare back to the most stable release.
I reckon it won't be long before I have my first bot, I think I'll call it "layawinner" :)

Quote    Reply   
avatar

birchy

Betfair Elite

Posts: 593 Member Since:May 11, 2008

#26 [url]

June 26, 2013 17:58:59

Python IS a joy to use! I've tried quite a few programming languages over the years and Python is by far the simplest, most productive, yet powerful language I have used. Be warned though, bot programming is highly addictive!

There's no need to compile your Python code to an exe unless you are planning on selling it or giving it to someone as an "all in one" package. When you start working with .py files instead of the live terminal, the standard method is to run your code from a command line using something like: "python mybot.py".

www.bespokebots.com

"This time next year Rodney, we'll be millionaires!"

Quote    Reply   
Remove this ad
avatar

factotum

rookie botter

Posts: 18 Member Since:April 21, 2013

#27 [url]

June 27, 2013 12:28:16

A bit of light reading eh... Just 574 pages long :)

Thanks chumby

When I finally develop my bot, it will be solely for my personal use, so I'll go the command line .py route as suggested.

Paul

Quote    Reply   
avatar

mrchameleon

rookie botter

Posts: 6 Member Since:April 19, 2009

#28 [url]

August 8, 2013 08:20:59


It's an excellent API that provides everything you'll need, nice and simply. Take time to learn a little python (relatively easy language to learn and you don't need to learn much of it), don't worry about GUIs, console I/O is quite good enough, and you will get a working bot happening as quickly as you possibly can.

Good on you, Birchy, you deserve some donations.

Quote    Reply   
avatar

birchy

Betfair Elite

Posts: 593 Member Since:May 11, 2008

#29 [url]

August 8, 2013 19:02:01


@mrchameleon: Sounds like you've got some experience with the new API-NG? It should be fairly easy to use due to Python's standard JSON library but I guess I'm resisting as I don't want to re-write my bots yet. In your opinion, is the API now usable for production bots (i.e. 24/7 running)?

www.bespokebots.com

"This time next year Rodney, we'll be millionaires!"

Quote    Reply   
avatar

mrchameleon

rookie botter

Posts: 6 Member Since:April 19, 2009

#30 [url]

August 10, 2013 23:48:51

Hi @birchy

Actually I don't have any experience with the new JSON API, but I gather it's not ready for prime-time yet.

My betting style doesn't require ultra-low latency so I'm sticking with my python wrapper around your excellent python library for the time being.

I think the move to the JSON library will be fairly painless when the time come (famous last words).

Quote    Reply   
avatar

birchy

Betfair Elite

Posts: 593 Member Since:May 11, 2008

#31 [url]

August 12, 2013 17:45:45

Sounds like we're in the same boat mrchameleon. My bots are only ticking over at 5 second refreshes and I have a tried and tested API library that I know I can rely on, so there is zero incentive to "upgrade".

www.bespokebots.com

"This time next year Rodney, we'll be millionaires!"

Quote    Reply   
avatar

vonnch

rookie botter

Posts: 24 Member Since:November 24, 2013

#32 [url]

September 27, 2014 16:08:54

Look like this one was caused by an unplanned maintenance from their end. Looks good so far. image

Quote    Reply   
Remove this ad
Add Reply

Quick Reply

bbcode help