
python
python
RayXLei
这个作者很懒,什么都没留下…
展开
-
python 拆分大文件
如有大文件 batch.sql,需要拆分成小文件: srcfile = 'c:\\batch.sql' target = 'c:\\target\\' #拆分到该目录下 lines = [] num = 0 fn = 0 with open(srcfile,'r') as src: for line in src: n += 1 lines.append(line) #100行拆分一...原创 2020-03-10 22:56:52 · 198 阅读 · 0 评论 -
python 字符串匹配
text = "123456" text.find("1") #0 text.find("0") #-1原创 2020-03-10 21:12:58 · 144 阅读 · 0 评论 -
Elasticsearch 使用 Python 导入数据
Elasticsearch 使用 Python 导入数据 from elasticsearch import Elasticsearch #引入 es 模块 import csv #引入 python 自带的 csv 模块 #from elasticsearch import helpers ip = 'xxx.xxx.xxx.xxx' port = xxxx es = Elastics...原创 2019-12-25 17:59:03 · 1594 阅读 · 1 评论