{"action":"created","issue":{"url":"https://api.github.com/repos/OpenMindClub/OMOOC2py/issues/21","labels_url":"https://api.github.com/repos/OpenMindClub/OMOOC2py/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/OpenMindClub/OMOOC2py/issues/21/comments","events_url":"https://api.github.com/repos/OpenMindClub/OMOOC2py/issues/21/events","html_url":"https://github.com/OpenMindClub/OMOOC2py/issues/21","id":111963590,"number":21,"title":"[1w]课程相关 技术问题 讨论","user":{"login":"ZoomQuiet","id":22494,"avatar_url":"https://avatars.githubusercontent.com/u/22494?v=3","gravatar_id":"","url":"https://api.github.com/users/ZoomQuiet","html_url":"https://github.com/ZoomQuiet","followers_url":"https://api.github.com/users/ZoomQuiet/followers","following_url":"https://api.github.com/users/ZoomQuiet/following{/other_user}","gists_url":"https://api.github.com/users/ZoomQuiet/gists{/gist_id}","starred_url":"https://api.github.com/users/ZoomQuiet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZoomQuiet/subscriptions","organizations_url":"https://api.github.com/users/ZoomQuiet/orgs","repos_url":"https://api.github.com/users/ZoomQuiet/repos","events_url":"https://api.github.com/users/ZoomQuiet/events{/privacy}","received_events_url":"https://api.github.com/users/ZoomQuiet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OpenMindClub/OMOOC2py/labels/help%20wanted","name":"help wanted","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"ZoomQuiet","id":22494,"avatar_url":"https://avatars.githubusercontent.com/u/22494?v=3","gravatar_id":"","url":"https://api.github.com/users/ZoomQuiet","html_url":"https://github.com/ZoomQuiet","followers_url":"https://api.github.com/users/ZoomQuiet/followers","following_url":"https://api.github.com/users/ZoomQuiet/following{/other_user}","gists_url":"https://api.github.com/users/ZoomQuiet/gists{/gist_id}","starred_url":"https://api.github.com/users/ZoomQuiet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZoomQuiet/subscriptions","organizations_url":"https://api.github.com/users/ZoomQuiet/orgs","repos_url":"https://api.github.com/users/ZoomQuiet/repos","events_url":"https://api.github.com/users/ZoomQuiet/events{/privacy}","received_events_url":"https://api.github.com/users/ZoomQuiet/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/OpenMindClub/OMOOC2py/milestones/2","html_url":"https://github.com/OpenMindClub/OMOOC2py/milestones/1.2.OMOOC.py","labels_url":"https://api.github.com/repos/OpenMindClub/OMOOC2py/milestones/2/labels","id":1338153,"number":2,"title":"1.2.OMOOC.py","description":"2w~7w 基础旋进 相关讨论","creator":{"login":"ZoomQuiet","id":22494,"avatar_url":"https://avatars.githubusercontent.com/u/22494?v=3","gravatar_id":"","url":"https://api.github.com/users/ZoomQuiet","html_url":"https://github.com/ZoomQuiet","followers_url":"https://api.github.com/users/ZoomQuiet/followers","following_url":"https://api.github.com/users/ZoomQuiet/following{/other_user}","gists_url":"https://api.github.com/users/ZoomQuiet/gists{/gist_id}","starred_url":"https://api.github.com/users/ZoomQuiet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZoomQuiet/subscriptions","organizations_url":"https://api.github.com/users/ZoomQuiet/orgs","repos_url":"https://api.github.com/users/ZoomQuiet/repos","events_url":"https://api.github.com/users/ZoomQuiet/events{/privacy}","received_events_url":"https://api.github.com/users/ZoomQuiet/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":4,"state":"open","created_at":"2015-10-05T12:54:45Z","updated_at":"2015-10-22T06:50:45Z","due_on":"2015-11-27T16:00:00Z","closed_at":null},"comments":9,"created_at":"2015-10-17T13:37:53Z","updated_at":"2015-10-22T10:29:58Z","closed_at":null,"body":"- 参考: \r\n    + [缩写](https://github.com/OpenMindClub/OMOOC2py/wiki/HbShortRule)\r\n    + [典章:说与菜鸟 | PyChina.org Static Wiki](http://wiki.pychina.org/hd/FreshProposeFor.html)\r\n    + [提问的智慧](http://wiki.woodpecker.org.cn/moin/AskForHelp)\r\n        * [5W1H](http://wiki.woodpecker.org.cn/moin/5W1H)\r\n        * [SMART原则 - MBA智库百科](http://wiki.mbalib.com/wiki/SMART%E5%8E%9F%E5%88%99)\r\n    + ...\r\n- 技术讨论一定要认真的提供可以复现问题的足够信息\r\n- 否则其他人是无法用脑补来还原你的场景的\r\n- 特此草拟如下提问模板,以便学员使用:\r\n\r\n\r\n:\r\n\r\n    ## 背景\r\n    - 系统:\r\n    - 版本:\r\n    - 代码:\r\n    - ...\r\n\r\n    ## 现象\r\n    - 输入: ..\r\n    - 触发: ..\r\n    - 问题: 非期待...\r\n\r\n    ## 分析\r\n    - 尝试0:\r\n        - 参考:\r\n        - 判断:\r\n        - 实验:\r\n        - 结论:\r\n    - 尝试1:\r\n        - 参考:\r\n        - 判断:\r\n        - 实验:\r\n        - 结论:\r\n    - 尝试2:\r\n        - 参考:\r\n        - 判断:\r\n        - 实验:\r\n        - 结论:\r\n    - ...\r\n\r\n    ## 方案\r\n    - 解决思路0:\r\n        - 参考:\r\n        - 设想:\r\n    - 解决思路1:\r\n        - 参考:\r\n        - 设想:\r\n    - 解决思路2:\r\n        - 参考:\r\n        - 设想:\r\n\r\n    哪种思路正确,或是其它思路?\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/OpenMindClub/OMOOC2py/issues/comments/150174191","html_url":"https://github.com/OpenMindClub/OMOOC2py/issues/21#issuecomment-150174191","issue_url":"https://api.github.com/repos/OpenMindClub/OMOOC2py/issues/21","id":150174191,"user":{"login":"doreenduo43","id":14859531,"avatar_url":"https://avatars.githubusercontent.com/u/14859531?v=3","gravatar_id":"","url":"https://api.github.com/users/doreenduo43","html_url":"https://github.com/doreenduo43","followers_url":"https://api.github.com/users/doreenduo43/followers","following_url":"https://api.github.com/users/doreenduo43/following{/other_user}","gists_url":"https://api.github.com/users/doreenduo43/gists{/gist_id}","starred_url":"https://api.github.com/users/doreenduo43/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doreenduo43/subscriptions","organizations_url":"https://api.github.com/users/doreenduo43/orgs","repos_url":"https://api.github.com/users/doreenduo43/repos","events_url":"https://api.github.com/users/doreenduo43/events{/privacy}","received_events_url":"https://api.github.com/users/doreenduo43/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T10:29:58Z","updated_at":"2015-10-22T10:29:58Z","body":"系统：mac yosemite 10.10.5\r\npython: Python 2.7.10\r\n\r\n问题：\r\n当指定mode时，则无法读取文件\r\n\r\n例：写为\r\nf = open('diarybook.txt','a+')\r\n\r\nprint f.read()\r\n返回结果为 一个空行。\r\n\r\n写为\r\nf = open('diarybook.txt','r')\r\n\r\nprint f.read()\r\n则返回文件中已经写入的内容。\r\n\r\n把mode指定为w\r\n也会正常运作，把文件清空。等待写入。\r\n\r\n看了笨方法关于文件读取与写入的章节，外加python系统自带help(file)，外加google搜索（关键词为： python 文件 读取 a+）。仍然无解。\r\n\r\n虽然在最后我提交的代码里，我换成了“打开，读取，关闭”之后，再“打开，追加写入，关闭”的方式写了代码。但是我还是不明白mode为a+的话为什么就不能一起实现先打开，再追加写入呢？\r\n\r\n这个问题昨天折磨了我两个小时，希望能帮帮忙，谢谢。"}}