How to do it...

  1. Define the command interface. This is an exercise in User Experience (UX) design. While most UX is focused on web and mobile device applications, the core principles are appropriate for CLI applications and servers, as well.


Earlier, we noted that the root application will be craps. It will have the following three subcommands:

      craps simulate -o game_file -g games 
      craps summarize -o summary_file game_file ... 
      craps simsum -g games 
  1. Define the root Python application. Consistent with other files in this book, we'll call it ch13_r08.py. At the OS level, we can provide an alias or a link to make the visible interface match the user expectation of craps.
  2. We'll import the class definitions from the Combining many applications ...

Get Modern Python Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.