-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a basic CLI for easy testing #21
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not super familiar with this dunder filename, will it still allow us to from wrdcld import make_word:cloud
?
import argparse | ||
|
||
|
||
def parse_args(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just for my own understanding more than anything, what are the benefits of having a CLI rather than just using scripts? Is it a matter of preference or?
|
||
def load_words_from_file(file_path): | ||
try: | ||
with open(file_path, encoding="utf-8") as file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't like the read_text
method huh? 😋
I changed the default branch to |
Thanks! I will get back to this later in the week. :) |
Fixes #20
Added main.py for the CLI.
Also moves the entrypoint out of init.py and into main.py
Try it out with for example
python -m wrdcld examples/dancingmen.txt