-
-
Notifications
You must be signed in to change notification settings - Fork 42
London | SDC-Nov-25 | Pezhman Azizi | Sprint 4 | Implement shell Tools In Python #299
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
base: main
Are you sure you want to change the base?
London | SDC-Nov-25 | Pezhman Azizi | Sprint 4 | Implement shell Tools In Python #299
Conversation
LonMcGregor
left a comment
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.
Good start on this sprint's tasks, I have spotted a few areas where you could improve code further
Very nicely formatted PR text!
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.
This script works well, but you may want to take another look at the readme for this task, you seem to be missing some features
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.
Good neat script!
| if args.count_words: | ||
| totals_output.append(str(totals[1])) | ||
| if args.count_bytes: | ||
| totals_output.append(str(totals[2])) |
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.
Can you see the repetition in the structure of the output part of the script? can you think of any way to improve this?
| output_parts.extend([str(lines), str(words), str(bytes_)]) | ||
| else: | ||
| if args.count_lines: | ||
| output_parts.append(str(lines)) |
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.
When multiple files are given, does the output look neat enough? is there any way you could improve how it looks?
Learners, PR Template
Self checklist
Changelist
This PR adds Python implementations of the three shell tools required for the sprint: cat, ls, and wc.
Each tool is implemented in its own commit for clarity and easier review.
This PR adds Python implementations of the three shell tools required for the sprint:
cat,ls, andwc.Each tool is implemented in its own commit for clarity and easier review.
🔹 What's Included
cat.py
argparsecatls.py
-1(one entry per line)-a(show hidden files)os.listdir()and simple filteringwc.py
-l,-w,-ctotallineargparseand UTF-8 byte counting🔹 Notes
cat,ls,wc)