![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
啊辉的小号
多学习,才能进步
展开
-
python 生成excel文件
使用python 输出excel文件import xlwtimport randomlonlat=[]wb = xlwt.Workbook()ws = wb.add_sheet('point')for i in range(1000): lon = random.uniform(116.313903, 116.471488) lat = random.uniform(39.869917, 39.991809) lonlat.append({'lon': lon, '原创 2021-01-26 10:41:22 · 230 阅读 · 0 评论 -
python json 的读和写
关于json 读和写的笔记import json#读取json 文档f = open("id_value.json", "r")content = f.read()a = json.loads(content)tt = {}features= a["features"]list_feat = []for obj in features: list_feat.append({"id": obj["properties"]["id"], "value": obj["propert原创 2021-01-19 18:20:18 · 85 阅读 · 0 评论 -
python 笔记 移动文件
1.获取某文件夹下的所有 文件import osos.walk(filePath)2.将文件移动到另一个文件夹下import osimport shutilimport traceback def move_file(src_path, dst_path, file): print ('from : ',src_path) print ('to : ',dst_path) try: # cmd = 'chmod -R +x ' + sr原创 2020-07-09 11:21:22 · 205 阅读 · 0 评论