Refactor file handling to use pathlib, add .gitignore file, and apply PEP8 fixes - #1
Open
mahdirahimi1999 wants to merge 2 commits into
Open
Conversation
- Replaced open() calls with Path.read_text() and Path.write_text() for file I/O operations. - Simplified code for handling JSON files and improved readability.
Author
|
Please check this PR. |
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.
Summary:
This pull request refactors the file handling code to use
pathlibinstead ofopen(), improving readability and simplicity. A.gitignorefile has also been added, and several changes have been made to comply with PEP8 style guidelines.Changes:
open()calls withPath.read_text()andPath.write_text()for file I/O operations.pathlib..gitignorefile to exclude unnecessary files from version control.Why this is important:
pathlibprovides a more Pythonic approach for file path handling and text reading/writing.pathlibis the modern way to handle file paths in Python, and this change aligns with modern Python practices..gitignorefile ensures that unnecessary files are excluded from version control.Please review the changes and let me know if you have any questions or suggestions.