07 2020 档案
摘要:git log # 查看提交的记录 git reset --hard { commit} #上面log中的commit id号 此时本地文件已经回滚到刚刚commit 之后的状态,但是服务器仍然没有改变,需要继续远程回滚:git push -f
阅读全文
摘要:/usr/share/wallpapers/deepin /usr/share/wallpapers/deepin
阅读全文
摘要:dumps是将python的字典转化成json字符串、dump转换完成后写入文件 import json dict1 = {'name': 'fam', 'age': 19} print(type(json.dumps(dict1))) f = open('fan.txt', 'w') json.d
阅读全文
摘要:类的静态函数,类函数,普通函数,全局变量以及内置属性都放在类__dict__中,对象的__dict__中存储了self.xx的东西 class A(object): a = 0 b = 1 def __init__(self): self.a = 2 self.b = 3 def test(self
阅读全文
摘要:test.py __all__ = ["fun1", "fun2"] def fun1(): print(111) def fun2(): print(2222) def fun3(): print(3333) if __name__ == '__main__': pass test1.py 如果定
阅读全文
摘要:学习链接 import logging logging.basicConfig(level=logging.INFO) s = '0'n = int(s)logging.info('n = %d' % n)print(10 / n) 这就是logging的好处,它允许你指定记录信息的级别,有debu
阅读全文
摘要:下载文件def down_kms(autho_details_id, headers): url = '❂' res = s.get(headers=headers, url=url) with open('kms_mips.kms', 'wb') as f: f.write(res.content
阅读全文
摘要:安装zsh sudo apt-get install zshcd /binfind -name zsh #n安装成功 chsh -h # 查看用法chsh -s /bin/zsh # 替换了 安装Git sudo apt-get install git 安装oh-my-zsh sh -c "$(cu
阅读全文
摘要:https://blog.csdn.net/eleanoryss/article/details/70207767
阅读全文
摘要:ProcessPoolExecutor ProcessPoolExecutor import multiprocessing print(multiprocessing.cpu_count()) 如果是cpu密集型 i线程池数量i就是cpu逻辑核数 如果是IO密集型, 最大线程数就是2倍的cpu逻辑
阅读全文
摘要:https://blog.csdn.net/a5186050/article/details/77966095
阅读全文
摘要:import configparsercf = configparser.ConfigParser() cf.read('config.ini') # 获取配置文件对象 app_name = cf.get('test-client', "path") # 读取test-client模块下的path变
阅读全文
摘要:import os print(os.environ['HOME'])environ 是以键值对的形式存放的就是python的字典,源码如下 linux 查看环境变量命令 :env
阅读全文
摘要:pip freeze > requirements.txt # 查看依赖包,导入到requirements.txt pip install -r requirements.txt #安装requirements.txt中所有的包
阅读全文
摘要:https://www.cnblogs.com/echo-valley/p/8268527.html ls -lt /dirname/ |grep filname | head -n 1 | awk '{print $9}' ls -lt /dirname/ 获取文件并按时间先后排序 grep fi
阅读全文