Add tests and planning doc

This commit is contained in:
Chris Proctor
2023-08-04 13:07:47 -04:00
parent cdfff4eb5f
commit 62f2ccef87
4 changed files with 131 additions and 67 deletions

7
nw.py
View File

@@ -1,13 +1,14 @@
# cli.py
# nw.py
# ------
# Implements a simple number-to-text command-line interface.
# Ex: python nw.py 145
from argparse import ArgumentParser
from numberwords import int_under_1000000_to_text
from numberwords import int_under_1000000_to_str
parser = ArgumentParser("Print out a number as it is spoken in English.")
parser.add_argument("number", type=int)
args = parser.parse_args()
text = int_under_1000000_to_text(args.number)
text = int_under_1000000_to_str(args.number)
print(text)