Repository navigation
London | 26-jul-SDC | Shaghayegh far| Sprint 4 | Implement shell tools with python - #653
shaghayeghfar wants to merge 3 commits into
Conversation
LonMcGregor
left a comment
There was a problem hiding this comment.
I've spotted a couple of initial issues here, can you take another look at this?
| import sys | ||
|
|
||
| # Check if the user used a flag | ||
| if len(sys.argv) > 1 and sys.argv[1] == "-n": |
There was a problem hiding this comment.
Is there a library or API you could use to handle arguments for you?
There was a problem hiding this comment.
Thank you for your feedback. I've updated my code to use Python's built-in argparse library to handle command-line arguments.
|
|
||
| # Count lines | ||
| lines = len(content.splitlines()) | ||
|
|
There was a problem hiding this comment.
Why are you leaving so much space between lines here?
|
|
||
|
|
||
| # Print the result | ||
| print(answer + filename) No newline at end of file |
There was a problem hiding this comment.
If you run this with multiple files, is there anything missing?
|
Dear @LonMcGregor |
Learners, PR Template
Self checklist
Implemented cat, ls, wc with python
Task code: CYF-1152