Skip to content

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

Open
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

eediallo
Copy link

@eediallo eediallo commented Mar 8, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

[Elhadj Abdoul Diallo] added 30 commits March 5, 2025 16:00
@eediallo eediallo added the Needs Review Participant to add when requesting review label Mar 8, 2025
@eediallo eediallo changed the title Elhadj Abdoul | Diallo | Module-Tools | WEEK4 - Implement-shell-tools-python London | Diallo | Module-Tools | WEEK4 - Implement-shell-tools-python Mar 8, 2025
@eediallo eediallo changed the title London | Diallo | Module-Tools | WEEK4 - Implement-shell-tools-python London | Elhadj Abdoul Diallo | Module-Tools | WEEK4 - Implement-shell-tools-python Mar 8, 2025
return lines

def output_lines_with_numbers(lines):
count = 0

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()

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)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review Participant to add when requesting review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants