
python
Yeva
如果非要做些什么,那就做自己热衷的事
展开
-
python合并master到各开发分支
背景 处于配置管理一职,在每次发布上线后,需要将master分支内容合并到各开发分支 python模块 涉及到git和repo库 from git import Repo from git import Git conflict_branch = [] # 路径 repo = Repo("D:/gitlab-1/lis") gitlab = Git("D:/gitlab-1/lis") # print(repo.branches) branches = gitlab.execute('git bran.原创 2021-09-24 09:56:06 · 369 阅读 · 0 评论 -
python 勒索信
python 勒索信描述方法一:统计字符数量方法二:剪切字符串其他:(欢迎留言交流) 描述 在一本杂志中剪切出一些字母,构成一封勒索信的内容。写一个方法判断杂志的内容能否构成这封勒索信,如果可以,返回True;否则返回False。要求杂志字符串中的每一个字符仅能在勒索信中使用一次。 方法一:统计字符数量 # 勒索信 def demo8(ransomnote, magazine): chardict = [0]*26 # 统计字符数量 for c in magazine:原创 2021-06-02 11:23:16 · 480 阅读 · 0 评论 -
python的os.listdir()顺序不定
【问题描述】打印某文件夹下的内容,如下 '[checkreport_20210104121003.xlsx', 'checkreport_20210104121003.html', 'checkreport_20210104131002.xlsx', 'checkreport_20210104131002.html', 'checkreport_20210104141002.xlsx', 'checkreport_20210104141002.html'] 文件名虽然按从小到大的顺序排列了,但后缀名并未顺序原创 2021-01-04 16:26:32 · 1413 阅读 · 0 评论