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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a really interesting point @jeremycward ! thank you !

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will. thank you

@eediallo
Copy link
Author

Hey @jeremycward ! Thank you very much for reviewing my code. Could you please add a complete label to this PR?

@jeremycward
Copy link

jeremycward commented Apr 28, 2025 via email

@jeremycward jeremycward added 🐂 Size Medium 1-4 hours Complete Volunteer to add when work is complete and review comments have been addressed and removed 🐂 Size Medium 1-4 hours Needs Review Participant to add when requesting review labels May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and review comments have been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants