随笔分类 - python的模块
摘要:正则表达式 一、普通字符 . 通配符一个.只匹配一个字符 匹配任意除换行符"\n"外的字符(在DOTALL模式中也能匹配换行符 >>> import re >>> re.findall("abcd","abcdrbnmjfsdsaeedsss") ['abcd'] >>> re.findall("a
阅读全文
摘要:一、XML介绍 xml是实现不同语言或程序直接进行数据交换的协议,跟json差不多,单json使用起来更简单,不过现在还有很多传统公司的接口主要还是xml xml跟html都属于是标签语言 <data> <country name="Liechtenstein"> <rank updated="ye
阅读全文
摘要:1、getcwd() 获取当前工作路径 import os print(os.getcwd()) C:\python35\python3.exe D:/pyproject/day21模块/os模块.py D:\pyproject\day21模块 2、chdir() 改变当前工作路径 import o
阅读全文
摘要:Get the next random number in the range [0.0, 1.0) 取0到1直接的随机浮点数 import random print(random.random()) C:\python35\python3.exe D:/pyproject/day21模块/rand
阅读全文
摘要:time内置模块的方法 1、time() 时间戳 time() -> floating point number 浮点数 Return the current time in seconds since the Epoch. Fractions of a second may be present
阅读全文