GitHub PullRequestReviewCommentEvent at 2014-03-29 18:46:09
Repository: python-data-intro
Actor: lehmannro
Payload: {"comment":{"url":"https://api.github.com/repos/OpenTechSchool/python-data-intro/pulls/comments/11094619","id":11094619,"diff_hunk":"@@ -273,7 +273,25 @@ If you want to try all this out, here's a quick exercise to make sure you've got\n \n When writing to the files, remember that `print()` adds a newline but with `write()` you have to add the newline yourself.\n \n-Hopefully pretty simple, but that should make sure you have all the above ideas down-pat.\n+Hopefully pretty simple, but you should make sure you have all the above ideas down-pat.\n+\n+### Python 2.x and 3.x\n+\n+It's useful to have seen everything above, but there is a preferred way to handle these intricacies. It uses a python reserved word: `with`. Unfortunately, python is in a transition period between 2.7 and 3.x, so there is an added complication. This tutorial is based on 2.7, while the future will be 3.x. The good news is, you can properly write code that will work in both versions by adding the following line to 2.7 code once (near the top of your script with other imports): \n+\n+    from __future__ import absolute_import, division, print_function\n+\n+If you are using version 3.0 (or a higher number), feel free to leave it out (though it doesn't hurt to leave it in, either). But, assuming you are using 2.7, see how to print an example file below: ","path":"core/text-files.md","position":13,"original_position":13,"commit_id":"03eac6d1900da807fa940dc9ff9ffa97622db8d2","original_commit_id":"03eac6d1900da807fa940dc9ff9ffa97622db8d2","user":{"login":"lehmannro","id":33013,"avatar_url":"https://avatars.githubusercontent.com/u/33013?","gravatar_id":"df102fb8cc918bd2ed55ebdf51f79555","url":"https://api.github.com/users/lehmannro","html_url":"https://github.com/lehmannro","followers_url":"https://api.github.com/users/lehmannro/followers","following_url":"https://api.github.com/users/lehmannro/following{/other_user}","gists_url":"https://api.github.com/users/lehmannro/gists{/gist_id}","starred_url":"https://api.github.com/users/lehmannro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehmannro/subscriptions","organizations_url":"https://api.github.com/users/lehmannro/orgs","repos_url":"https://api.github.com/users/lehmannro/repos","events_url":"https://api.github.com/users/lehmannro/events{/privacy}","received_events_url":"https://api.github.com/users/lehmannro/received_events","type":"User","site_admin":false},"body":"I'm not sure if \"print an example file\" is language non-programmers would use/understand.  Maybe \"write\" is a better fit?","created_at":"2014-03-29T18:46:09Z","updated_at":"2014-03-29T18:46:09Z","html_url":"https://github.com/OpenTechSchool/python-data-intro/pull/6#discussion_r11094619","pull_request_url":"https://api.github.com/repos/OpenTechSchool/python-data-intro/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/OpenTechSchool/python-data-intro/pulls/comments/11094619"},"html":{"href":"https://github.com/OpenTechSchool/python-data-intro/pull/6#discussion_r11094619"},"pull_request":{"href":"https://api.github.com/repos/OpenTechSchool/python-data-intro/pulls/6"}}}}