from cards_deck.deck import Deck
= Deck()
d print(f'Number of playing cards in the deck: {len(d)}')
Number of playing cards in the deck: 52
This repo uses code based on Allen Downey’s ThinkPython2.
After cloning this repository:
pip install -e .
Playing cards in python!
Number of playing cards in the deck: 52
See the docs for more info.
draw_cards
cli:We included a handy cli you can use to draw cards as well!
usage: draw_cards [-h] [--replace] [--outfile OUTFILE] n
Draw `n` cards optionally with replacement
positional arguments:
n number of cards to draw
optional arguments:
-h, --help show this help message and exit
--replace whether or not draw with replacement (default: False)
--outfile OUTFILE output file, defaults to stdout