Args module
Provide the classes and functions to handle CLI arguments and options.
This module allows the handle CLI arguments and options.
The module contains the following classes and functions:
- Args(NamedTuple)
- A class to create a namedtuple to handle arguments for CLI
- parse_args
- Returns type handled tuple with information about the players and initial Mark.
Args
Bases: NamedTuple
A class that handle arguments for CLI. Extends NamedTuple
Attributes:
Name | Type | Description |
---|---|---|
player1 |
Player
|
Player An instance of subclass of the Player class that represents a human or computer. |
player2 |
Player
|
Player An instance of subclass of the Player class that represents a human or computer. |
renderer |
Player
|
Renderer An instance of subclass of the Renderer class that handles UI rendering. |
Source code in src\frontend\console\args.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
parse_args()
Returns type handled tuple with information about the players and initial Mark.
Returns:
Name | Type | Description |
---|---|---|
Args |
Args
|
tuple[Player, Player, Mark] tuple with players and Mark |
Source code in src\frontend\console\args.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|