-
Notifications
You must be signed in to change notification settings - Fork 1
Команда grep #5
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: master
Are you sure you want to change the base?
Команда grep #5
Conversation
yurii-litvinov
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.
В целом всё правильно, зачтена
|
|
||
| ### grep | ||
|
|
||
| Для работы grep выбрана стандартная библиотека Питона для работы с регулярными выражениями re, потому что она хорошо работает и не приходится доставлять никакие зависимости. |
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.
Но не написано, какие ещё библиотеки были рассмотрены. Похоже на "золотой молоток", хотя в случае с Питоном действительно всё просто.
| nlines = 0 | ||
| if arglist.count('-A') > 0: | ||
| idx = arglist.index('-A') | ||
| snum = arglist[idx+1] |
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.
Надо пробелы вокруг бинарных операторов
| nlines = 0 | ||
| if arglist.count('-A') > 0: | ||
| idx = arglist.index('-A') | ||
| snum = arglist[idx+1] |
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.
И тут бы ещё неплохо проверять, что такой индекс вообще существует, иначе на grep -A хоть и не падает, но ругается довольно странно.
No description provided.