Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
수정한 라인
Line 5-6
open(path, 'w')→open(path, 'r')로 변경원래 파일을 쓰기 모드로 열어서 읽을 수 없었고,
lines변수가 정의되지 않아서 에러가 났습니다.Line 14
if '/' or '"' in file:→if '/' in file or '"' in file:로 수정논리 연산자 우선순위 문제로 조건문이 항상 True가 되어버렸습니다.
Line 20
template_start = '{\"German\":\"'→'{\"English\":\"'로 변경JSON의 첫 번째 키가 "German"으로 되어있어서 "English"가 아니라 "German"이 두 번 나왔습니다.
Line 28
english_file = process_file(german_file)→german_file = process_file(german_file)로 수정german_file을 처리한 결과를 english_file에 할당해서 german_file이 제대로 처리되지 않았습니다.
Line 30
템플릿 조합 순서가 잘못되어서 JSON 형식이 맞지 않았습니다.
Line 36
open(path, 'r')→open(path, 'w')로 변경파일을 읽기 모드로 열어서 쓸 수 없었습니다.
Line 38
원래는 개행 문자만 써서 파일이 비어있었습니다.
Line 46, 48
잘못된 함수를 호출해서 프로그램이 실행되지 않았습니다.
왜 잘못되었는가
Line 5-6
파일을 쓰기 모드('w')로 열면 파일을 읽을 수 없고,
lines변수가 정의되지 않아서 NameError가 발생합니다.Line 14
if '/' or '"' in file:는if ('/') or ('"' in file):로 해석되어서'/'가 truthy 값이라 항상 True가 됩니다. 올바른 조건은if '/' in file or '"' in file:입니다.Line 20
JSON 템플릿의 첫 번째 키가 "German"으로 되어있어서 예상한 결과와 다르게 나왔습니다. "English"가 먼저 와야 합니다.
Line 28
변수 할당이 잘못되어서 german_file이 처리되지 않았습니다.
Line 30
템플릿 조합 순서가 잘못되어서 JSON 형식이 맞지 않았습니다.
Line 36-38
파일을 읽기 모드('r')로 열면 쓸 수 없고, 내용을 쓰지 않아서 파일이 제대로 생성되지 않았습니다.
Line 46, 48
함수 호출이 잘못되어서 프로그램이 실행되지 않았습니다.