擅长:python、mysql、java
<p>磁盘上那个文件的实际内容是什么?请注意,传递给<code>open(path).readline()</code>的<code>path</code>与启动<code>ipython pylab</code>时所在的当前目录相关。但是,您没有得到“文件未找到”错误,所以我假设文件存在于正确的位置。在</p>
<p>如何检索文件以在本地使用它?这本书并不具体。你去github页面下载zip包了吗?使用Git下载整个存储库?在浏览器中单击鼠标右键以保存文件?您是否确实下载了原始文件而不是代表该文件的HTML页面?在</p>
<p>编辑:OP确认他们的文件实际上是从浏览器右键单击保存的文件,实际上是一个HTML文件,而不是原始json文件。通过将整个包作为Zip从存储库的首页下载并在该包中工作,解决了这个问题。在</p>