Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add a basic CLI for easy testing #21

wants to merge 1 commit into from

Conversation

naslundx
Copy link
Collaborator

@naslundx naslundx commented Aug 18, 2024

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

Copy link
Owner

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():
Copy link
Owner

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:
Copy link
Owner

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? 😋

@jimbarrett27
Copy link
Owner

I changed the default branch to dev, so you'll need to change the target branch for this PR 😬

@naslundx
Copy link
Collaborator Author

I changed the default branch to dev, so you'll need to change the target branch for this PR 😬

Thanks! I will get back to this later in the week. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a CLI
2 participants