Python有用的内置函数
divmod,id,sorted,enumerate,input,oct,eval,exec,isinstance,ord,chr,filter,vars,zip
divmod,id,sorted,enumerate,input,oct,eval,exec,isinstance,ord,chr,filter,vars,zip
从bson中导入ObjectId对象,将字符串转换成id对象查询使用
最简单的实现了一下Python的多线程
使用threading写的一个定时器任务demo
总结了一下使用Python对xml文件的解析,用到的模块儿如下: 分别从xml字符串和xml文件转换为xml对象,然后解析xml内容,查询指定信息字段。 python from xml.dom.minidom import parse...
需要Python的socket模块,windows使用netstat -an查看端口状态,Linux使用netstat -tunlp查看端口状态。 python client 客户端 TCP必须建立连接 import socket #...
python import csv with open('test.csv',newline='') as f: reader = csv.reader(f) for row in reader: print(row)
###对数据: json = json.dumps(data) 编码 dict- string 排序sort keys=True, 缩进indent=4, 分隔符separators=(',', ': ') json = json.l...
采用os模块: python import os def get filelist(dir): for home, dirs, files in os.walk(dir): print("#######目录列表#######") fo...