June 2019
Beginner to intermediate
770 pages
19h 24m
English
When we decide to use Python as the notation for a configuration, we can use the exec() function to evaluate a block of code in a constrained namespace. We can imagine writing configuration files that look like the following code:
# SomeStrategy setup# Tabledealer_rule = Hit17()split_rule = NoReSplitAces()table = Table(decks=6, limit=50, dealer=dealer_rule, split=split_rule, payout=(3,2))# Playerplayer_rule = SomeStrategy()betting_rule = Flat()player = Player(play=player_rule, betting=betting_rule, max_rounds=100, init_stake=50)# Simulationoutputfile = Path.cwd()/"data"/"ch14_simulation3a.dat"samples = 100
This is a pleasant, easy-to-read set of configuration parameters. It's similar to the INI ...
Read now
Unlock full access