-
-
Notifications
You must be signed in to change notification settings - Fork 11
London | Elhadj Abdoul Diallo | Module-Tools | WEEK4 - Implement-shell-tools-python #38
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?
Conversation
…mprove formatting in ls command
…line extraction in output function
…cter count in wc command
…ction accordingly
…le paths in output
…eamline output for single file paths
… counts for multiple files
…based on selected flags
return lines | ||
|
||
def output_lines_with_numbers(lines): | ||
count = 0 |
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.
possibly rename 'number1' and 'number2 ' to 'line_number_on' and filter_empty_lines'
print(file, end=' ') | ||
if not is_file_per_line_option: | ||
print() | ||
|
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.
would good be a good idea, rather than printing directly to console, to add console lines to an in memory list, this would make it easier to direct the output whereever you want it, and to test.
For example, 'print' could be replaced by your own output function, like 'outputline', which either printed to console, or an in memory list. Then in python, you could monkey patch the 'outputline' function.
elif is_words_option: print(words_count, file_path) | ||
elif is_chars_option: print(chars_count, file_path) | ||
else: print(lines_count, words_count, chars_count, file_path) | ||
|
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.
have a look at tuples rather than a plain array for the count results
Learners, PR Template
Self checklist