Skip to Content
Mastering Object-oriented Python
book

Mastering Object-oriented Python

by Steven F. Lott
April 2014
Beginner to intermediate
634 pages
15h 22m
English
Packt Publishing
Content preview from Mastering Object-oriented Python

Storing the configuration in the INI files

The INI file format has historical origins from early Windows OS. The module to parse these files is configparser.

For additional details on the INI file, see this Wikipedia article: http://en.wikipedia.org/wiki/INI_file.

An INI file has sections and properties within each section. Our sample main program has three sections: the table configuration, player configuration, and overall simulation data gathering.

We can imagine an INI file that looks like the following code:

; Default casino rules [table] dealer= Hit17 split= NoResplitAces decks= 6 limit= 50 payout= (3,2) ; Player with SomeStrategy ; Need to compare with OtherStrategy [player] play= SomeStrategy betting= Flat rounds= 100 stake= 50 [simulator] ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Object-Oriented Python - Second Edition

Mastering Object-Oriented Python - Second Edition

Steven F. Lott

Publisher Resources

ISBN: 9781783280971Supplemental Content