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.

Exceptions:

LaTeXError

Raised when there was an error running pdflatex

Functions:

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

Execute a dealer script file

exception endplay.dealer.runscript.LaTeXError

Bases: RuntimeError

Raised when there was an error running pdflatex

endplay.dealer.runscript.run_script(script: Optional[str], show_progress: bool = False, produce: int = 40, generate: int = 1000000, seed: Optional[int] = None, verbose: bool = False, swapping: int = 0, outformat: str = 'plain', outfile: Optional[str] = None, constraints: list[str] = [], actions: list[str] = [], predeal: str = '', board_numbers: bool = False) list[endplay.types.deal.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