第3章 处理错误
import os
os.getcwd() <------------得到当前工作目录
os.chdir('/root/python/HeadFirstPython/chapter3') <---- 切换目录
os.path.exists('sketch.txt') <-------判断文件是否存在
split(':',1) <----以“:”分割,只分一次
if not each_line.find(':') == -1 <---------在each_line中查找“:” ,没有找到返回-1,否则返回1 ,1 == -1 返回flase
pass语句就是python的空语句或null语句,什么也不做