Skip to Content
Hands-On Reactive Programming with Python
book

Hands-On Reactive Programming with Python

by Romain Picard
October 2018
Intermediate to advanced
420 pages
10h 26m
English
Packt Publishing
Content preview from Hands-On Reactive Programming with Python

Parsing the configuration file

Parsing the configuration file requires three distinct parts, as shown previously in the reactivity diagram for the application:

  • Parsing the command-line arguments
  • Reading the configuration file
  • Parsing the configuration file and converting it to a Python object

Command-line arguments are retrieved with the argv driver of the cyclotron-std package, as already seen with the cyclotron echo example. The application accepts only one argument, named config. The Python standard library contains a module dedicated to the parsing of arguments: argparse. Moreover, the cyclotron-std package contains a helper to use the argparse module with an observable of arguments as an input. So, all these elements can be used as ...

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

Python Programming with Design Patterns

Python Programming with Design Patterns

James W. Cooper

Publisher Resources

ISBN: 9781789138726Supplemental Content