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

PCC54 yashaslokesh #410

Merged
merged 1 commit into from Nov 9, 2018
Merged

PCC54 yashaslokesh #410

merged 1 commit into from Nov 9, 2018

Conversation

yashaslokesh
Copy link
Contributor

ATTENTION: before clicking "Create Pull Request" please submit some meta data, thanks!

Difficulty level (1-10): [4]
Estimated time spent (hours): [3]
Completed (yes/no): [yes]
I stretched my coding skills (if yes what did you learn?): [Gained more experience representing datetime objects as strings in the format I want them, used error handling to make my code more concise, and found the useful string method splitlines() which gives a list of all strings separated by newlines. I can easily insert an element into the list and then reform the list into file contents. This is much easier than parsing through a string of all the file contents to find a certain location.]
Other feedback (what can we improve?): []

@pybites
Copy link
Owner

pybites commented Nov 9, 2018

Great learning documentation, thanks. Nice error handling. I like splitlines but it is not lazy, is it? Only recently found out that the file object is already a lazy generator of lines - see https://stackoverflow.com/a/519653

@pybites pybites merged commit 51b8e49 into pybites:community Nov 9, 2018
@yashaslokesh
Copy link
Contributor Author

Thanks for the tip, I'll remember to use it next time I'm reading in a file.

@yashaslokesh yashaslokesh deleted the PCC54 branch November 24, 2018 21:37
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.

None yet

2 participants