change path_to_file_list, train_file_list_to_json #240
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.
In the path_to_file_list function, the file is opened in 'w' mode (write mode), which is used for writing new content, not for reading. You need to open the file in read mode.
Correction: Change 'w' to 'r'.
In the path_to_file_list function, the code attempts to return a variable lines which has not been defined or assigned.
Correction: Add code to read the contents of the file and return it as a list.
Function Usage and Logic Error:
The train_file_list_to_json function has incorrectly implemented file processing. Additionally, the JSON string template is improperly structured.
Correction: Correctly structure the JSON template and accurately implement the string processing logic.
Incorrect File Writing Mode:
In the write_file_list function, the file is opened in 'r' mode (read mode), which is not suitable for writing. You need to use 'w' mode (write mode) or 'a' mode (append mode) for writing.
Correction: Change 'r' to 'w'.
Incorrect Function Call:
In the main block, the use of train_file_list_to_json and path_to_file_list functions is incorrect.
Correction: Correct the function calls to ensure they are properly used.