Skip to content

Commit

Permalink
添加勘误
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyeboy committed Nov 14, 2017
1 parent 28c0800 commit 4221947
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 1 deletion.
Binary file added 111页书写错误.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch07数据存储条件判断.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch07简单分布式爬虫.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dataoutput.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
119 changes: 118 additions & 1 deletion 勘误表.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,121 @@ p2.terminate()

![](P21.jpg)
<br>
感谢 [@Judy0513 ](@Judy0513 )
感谢 [@Judy0513 ](@Judy0513 )

#### 13.P107 逗号
![](P107逗号.jpg)
<br>
感谢 [@yaleimeng](@yaleimeng)
#### 14.P10语句不通顺
![](P10语句不通顺.jpg)
<br>
感谢 [@yaleimeng](@yaleimeng)
#### 15.P228多余缩进
![](P228多余缩进.jpg)
<br>
感谢 [@yaleimeng](@yaleimeng)
#### 16.P270缺少HTML头部
![](P270缺少HTML头部.jpg)
<br>
感谢 [@yaleimeng](@yaleimeng)
#### 17.P281代码与配图错误
![](P281代码与配图错误.jpg)
<br>
感谢 [@yaleimeng](@yaleimeng)[@doujanbo](@doujanbo )
#### 18.P397笔误
![](P397笔误.jpg)
<br>
感谢 [@yaleimeng](@yaleimeng)
#### 19.P43多余空格
![](P43多余空格.jpg)
<br>
感谢 [@yaleimeng](@yaleimeng)
#### 20.代码ch05/5.1.1.py
python3.x 无法 保存json文件问题
<br>
with open('qiye.json','wb') as fp:改为
<br>
with open('qiye.json','w') as fp:
#### 21.第七章:简单分布式爬虫提问
![](ch07简单分布式爬虫.jpg)
<br>
感谢 [@heqingbao](@heqingbao)
#### 22.第七章:代码中数据存储条件问题
![](ch07数据存储条件判断.jpg)
<br>
感谢 [@heqingbao](@heqingbao)
#### 23.111 页书写错误
![](111页书写错误.jpg)
<br>
感谢 [@BillWing726](@BillWing726)
#### 24.第六章 DataOutput
去掉 self.datas.remove(data)
#### 25.第七章 ControlNode DataOutput
self.datas.remove(data)改为
![](dataoutput.jpg)
#### 26.14页获取路径名的拼写错误
14页获取路径名的文件名拼写错误:
<br>
原文错误-->os.path.dirname(filetpah)
<br>
应该修正-->os.path.dirname(filepath)
<br>
感谢 [@exl2](@exl2)

#### 27.第31页代码结束符错误
![](第31页代码结束符错误.jpg)
感谢 [@exl2](@exl2)
#### 28.第146页爬虫调度器引用错误
![](第146页爬虫调度器引用错误.jpg)
感谢 [@wsl-victor](@wsl-victor)
#### 29.第一章17页
![](第一章17页.jpg)
感谢 [@liyang610](@liyang610)
#### 30.第一章,第17页,关于join方法的建议
```python
join方法阻塞运行直至该进程结束,如果需要等待所有子进程结束,建议针对每个进程调用该方法。

原书代码:
def run_proc(name):

print 'Child process %s (%s) Running...' % (name, os.getpid())
if name == 'main':

print 'Parent process %s.' % os.getpid()

for i in range(5):

p = Process(target=run_proc, args=(str(i),))

print 'Process will start.'

p.start()

p.join()

print 'Process end.'
建议将子进程规整入列表,以方便使用迭代处理每个进程,并“同步”每个进程,确保父进程在所有子进程结束后继续。修改如下:
def run_proc(name):

print 'Child process %s (%s) Running...' % (name, os.getpid())
if name == 'main':

print 'Parent process %s.' % os.getpid()
p=[]
for i in range(5):

p.append(Process(target=run_proc, args=(str(i),)))

print 'Process will start.'

p[i].start()
利用进程列表,确保子进程全部结束后父进程再继续

for process in p:
process.join()

print 'Process end.'


```
Binary file added 第146页爬虫调度器引用错误.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 第31页代码结束符错误.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 第一章17页.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4221947

Please sign in to comment.