Skip to content
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

Updated best practices method using pathlib #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abhijeetmote
Copy link

Hi All,
Please review the changes and do let me know this is my first commit.

.. code:: python

path = Path('file.txt')
with open(path, mode='at') as f:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with path.open("at") as f:

p = Path('file.txt')
p.read_text()

Using the above code we can not add mode(default is read mode), to do so there is another way mentioned below:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo mode(default is missing a space

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants