endplay.dealer.runscript

All-purpose routine for executing a dealer script file. This can be called directly from within Python to convert a dealer file into a list of deals, but its main purpose is as the entry point for the main module.

Functions:

run_script(script[, show_progress, produce, ...])

Execute a dealer script file

endplay.dealer.runscript.run_script(script: str | None, show_progress: bool = False, produce: int = 40, generate: int = 1000000, seed: int | None = None, verbose: bool = False, swapping: int = 0, outformat: str = 'plain', outfile: str | None = None, constraints: list[str] = [], actions: list[str] = [], predeal: str = '', board_numbers: bool = False) list[Deal]

Execute a dealer script file

Parameters:
  • script – The name of the script file to run

  • show_progress – Display a progress meter while hands are generated

  • produce – The number of hands to produce

  • generate – The maximum number of shuffles to perform

  • seed – The seed for the random number generator

  • verbose – Print extra debugging info and statistics at completion

  • swapping – The swapping algorithm to use (0=no swapping, 2=swap EW, 3=all permutations of SEW)

  • outformat – The format to print output in: ‘plain’, ‘latex’ or ‘pdf’

  • outfile – A filename to write the output to, if None then printed to stdout

  • constraints – A list of extra constraints to apply

  • actions – A list of extra actions to apply

  • predeal – A list of players and the suit holdings to deal to them

  • board_numbers – If True, print board numbers along with the generated deals

Returns:

The generated deals in a list