摘要: import osimport sys# print(os.getcwd())#取当前工作目录# os.chmod("/usr/local",7)#给文件/目录加权限# print(os.chdir(r"e:\byz_code\day2"))#更改当前目录# print(os.curdir)#当前目 阅读全文
posted @ 2017-06-24 09:48 喵咪的博客 阅读(240) 评论(0) 推荐(0) 编辑
摘要: import requests#1、打开网站 requests.get#2、从返回的html里面找到文章的超链接地址 正则表达式匹配#3、打开文章的超链接 requests.get#4、保存到本地 写文件url = 'http://www.baidu.cn/'req = requests.get(u 阅读全文
posted @ 2017-06-24 09:45 喵咪的博客 阅读(8111) 评论(0) 推荐(0) 编辑
摘要: os模块 print(os.getcwd())#取当前工作目录 print(os.chdir(r"e:\byz_code\day2"))#更改当前目录 print(os.mkdir("test1"))#创建文件夹 print(os.makedirs(r"test1\test2"))#递归创建文件夹, 阅读全文
posted @ 2017-06-24 09:38 喵咪的博客 阅读(206) 评论(0) 推荐(0) 编辑
摘要: import 模块的实质就是把要导入模块里面的代码,从上到下执行一遍 找模块的顺序是,先从当前目录下找,找不到的话,再环境变量里面找 标准模块: python自带的,不需要安装的,直接import就能用的 自己写的模块: 也就是自己写的python 第三方模块: 别人已经开发好的功能,需要安装的 安 阅读全文
posted @ 2017-06-24 09:33 喵咪的博客 阅读(99) 评论(0) 推荐(0) 编辑