-
Notifications
You must be signed in to change notification settings - Fork 9
광일공방 중고나라 #1, #2 코드리뷰 부탁드립니다. #4
The head ref may contain hidden characters: "\uC7A5\uC7AC\uC8FC"
Conversation
task2_original_jaeju는 파일에 저장하는 방식을 기반으로 처음 작성했던 스크립트이고, taks2_jaeju는 토요일 모임 후에 새로 짜본 코드입니다.
kwangilcho
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.
아주 좋습니다. 앞으로 이런 식으로 코드리뷰를 받으시면 되겠습니다.
새로 작성해주신 파일에 대해서만 코드리뷰를 진행하였습니다.
| print('3. 삭제하기') | ||
| print('-------------------------------------') | ||
|
|
||
| def action_execution(self): |
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.
함수 이름은 동사로 시작하는 것이 좋습니다.
execute_action은 어떨까요?
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.
아 그렇네요!
함수 자체의 실행적 느낌을 살려서 네이밍 해보도록 하겠습니다!
| except IndexError: | ||
| print('범위 밖의 숫자를 입력하셨습니다.') | ||
|
|
||
| def action_list(self): |
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.
함수 이름은 동사로 시작하는 것이 좋습니다.
list_actions은 어떨까요?
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.
아 이 부분도 action_list라고 하면 action들의 리스트라는 느낌이 더 강하겠네요!
감사합니다!
| if post_no < 1 or post_no > len(self.posts): | ||
| raise IndexError | ||
| del self.posts[post_no -1] | ||
| except ValueError: |
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.
에러 별 예외처리가 아주 좋네요!
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.
감사합니다!
| return | ||
|
|
||
| for index, post in enumerate(self.posts): | ||
| print('{글번호}. {글내용}'.format(글번호 = str(index + 1), 글내용 = post)) |
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.
formatted string 활용이 돋보입니다.
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.
감사합니다!
| board.show_posts() | ||
| board.action_list() | ||
| board.action_execution() | ||
| os.system('cls' if os.name == 'nt' else 'clear') |
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.
clear_screen() 함수를 만들어 놓고 쓰지 않았네요.
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.
아 그렇네요...ㅎㅎ
clear_screen 함수를 나중에 작성하고
바꾸질 못했네요
감사합니다!
2번 과제에서 txt 파일에 직접 저장해야한다고 잘못 생각해서 작성한 코드와
토요일에 새롭게 작성해본 코드 두 가지 다 올립니다.