11 2021 档案
摘要:1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 # Author:woshinidaye 4 import requests 5 #处理cookie,模拟用户登录!!!!!!!!! 6 ''' 7 #requests 8 #登录 -> 返回coo
阅读全文
摘要:1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 # Author:woshinidaye 4 5 #xpath是在XML文档中搜索内蒙的一门语言,html是xml的一个子集 6 #安装lxml模块 pip install lxml 7 8 9 f
阅读全文
摘要:1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 # Author:woshinidaye 4 5 # <h1>i love you</h1> 6 # <h2 align="center">i love you</h2> 7 # <a href="
阅读全文
摘要:1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 # Author:woshinidaye 4 5 import re 6 import csv 7 # #findall 匹配字符串中所有符合正则表达式的内容; 8 # list = re.find
阅读全文
摘要:1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 # Author:woshinidaye 4 #数据解析和提取 5 6 # 正则表达式 regular expression 7 # . :匹配除换行符外的任意一个字符,..就匹配两个 8 # \w
阅读全文
摘要:1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 # Author:woshinidaye 4 5 import os,sys 6 ''' 7 print(os.getcwd()) #获取当前工作目录 8 os.chdir('e:\\') #切换目
阅读全文
摘要:1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 # Author:woshinidaye 4 5 #处理时间的模块:time&datetime 6 import time,datetime 7 #1、时间戳 8 #time() -> floati
阅读全文
摘要:1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 # Author:woshinidaye 4 ''' 5 模块:从逻辑上组织python代码,本质就是.py文件 6 python package:带有一个__init__.py文件的文件夹 7 '
阅读全文
摘要:1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 # Author:woshinidaye 4 #正常读取文件的时候,文档使用字符串的形式写进去的。 5 # a = {'name':'woshinidaye','age':22} 6 # with
阅读全文
摘要:1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 # Author:woshinidaye 4 5 # for i in range(10): 6 # print(i) 7 8 # a = [] 9 # for i in range(10): 10
阅读全文
摘要:1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 # Author:woshinidaye 4 5 #装饰器:本质属于函数,语法:def,修饰其他函数,添加附加功能。 6 #类似于版本已经上线运行,现需要在版本中增加新功能,新特性且不能修改原版本文
阅读全文