Linux跨文件系统的文件夹和文件映射关系

Everything is a file 是Unix的设计理念,由其派生的Linux也如此。

2021-03-06 · 5 min · 2235 words · Garlic Space

mount操作导致磁盘数据丢失

cenos7X86_64 + openssh

2021-03-02 · 2 min · 710 words · Garlic Space

DIY esp8266 小盒子

前些天看到用esp8266开发的小盒子,按照教程https://www.instructables.com/3D-Printer-Monitor-Wemos-D1-Mini-ESP8266/操作了一下。 ...

2021-02-28 · 3 min · 1369 words · Garlic Space

LeetCode-Maximum XOR of Two Numbers in an Array

Given an integer array nums, return the maximum result of numsi XOR numsj, where 0 ≤ i ≤ j < n

2021-02-27 · 1 min · 311 words · Garlic Space

比特币,区块链与自由软件

这篇文章 Open source money: Bitcoin, blockchain, and free software

2021-02-24 · 4 min · 1793 words · Garlic Space

开源许可证

最近在学习python 使用到在操作package的时候,有一个步骤就是要增加一个“LICENSE”文件。

2021-02-21 · 8 min · 3593 words · Garlic Space

python语言学习

最新学习极客时间物联网课程中,老师使用的语言是python。之前也没有系统学习过,利用假期,跟着两个极客时间专栏学习了一下python 。

2021-02-17 · 9 min · 4435 words · Garlic Space

python 的 __name__

这篇文章The Reason Behind if name == ‘main’ in Python 是出自medium 作者 Jordan Will

2021-02-08 · 4 min · 1671 words · Garlic Space

python将多个excel合并

同一个excel文件,分配到各组填写, 最后统一汇总成一个文档反馈。 环境 windows10 python3.7 + openpyxl 目标 in目录存放各个组填写的文档 out目录存放合并后的结果文件 实现 表格 序号 产品 信息 反馈1 反馈2 01 产品1 X 00000 999999 02 产品2 X 11111 888888 03 产品3 X 22222 777777 代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 from openpyxl import load_workbook from openpyxl import Workbook import os ## 获取所有的文件 def getfilelist(dirname): li = [] for f in os.listdir(dirname): if f.endswith('.xlsx'): li.append(f) return li ## 更新 ## 1. 打开输出文件,处理一个sheet页面, ## 2. 循环获取某一行记录,放入字典结构从所有的输入文件中获取补充记录 ## 3. 如果是单条直接更新, 如果出现重复记录入职(暂不处理) ## 4. 依据以上处理方式,处理完所有sheet页面 INPATH=".\\in\\" OUTPATH=".\\out\\" productlist = ('product1','product2') ## 1. sheetname名称 ## 2. 位置1: 过滤条件 product 所在列位置,判断是否productlist ## 3. 位置2:通过判断第一个需要填写项判断是否填写数据 sheetlist = ( ('sheet1)', 6, 15), ('sheet2', 6, 13), ('sheet3', 5, 12), ('sheet4', 6, 14)) def update(): inlist = getfilelist(".\\in") outlist = getfilelist(".\\out") for li in sheetlist: sheetname = li[0] product = li[1] firstfilled= li[2] d = readdata(inlist, sheetname, product, firstfilled) writedata(outlist, d, sheetname) def readdata(inlist, sheetname, product, firstfilled): d = {} for i in inlist: wb = load_workbook(filename = INPATH+i) ws = wb[sheetname] row = tuple(ws.rows) c = filter(lambda cell: (cell[product].value in productlist) and (cell[firstfilled].value is not None), row) for cell in c: d[cell[0].row] = cell return d def writedata(outlist, d, sheetname): wbout = load_workbook(filename = OUTPATH+outlist[0]) wsout = wbout[sheetname] print(sheetname) #for key in d.keys(): for key in d: for col in range(1, wsout.max_column+1): wsout.cell(row=key, column=col).value = d[key][col-1].value wbout.save(filename = OUTPATH+outlist[0]) update() 代码调整: ...

2021-02-03 · 2 min · 631 words · Garlic Space

LeetCode- Add and Search Word - Data structure design Solution

leetcode 211 Trie的添加及搜索

2021-01-27 · 3 min · 1465 words · Garlic Space