摘要: 规范化Python imports(according to PEP8)也是一种良好的开发习惯,具体的说明参考https://www.python.org/dev/peps/pep-0008/。 这个提供一个对python imports 进行排序的工具reorder-python-imports. 阅读全文
posted @ 2020-12-11 15:27 LCdre 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Packaging 的相关内容/用法 https://packaging.python.org/tutorials/packaging-projects/ https://packaging.python.org/guides/distributing-packages-using-setuptoo 阅读全文
posted @ 2020-09-25 15:56 LCdre 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 推荐一篇Brendan Maginnis的文章 https://sourcery.ai/blog/python-best-practices/, 文件介绍了开始一个Python project的最佳实践,也包括了一些Python项目中有用的工具,比如pytest, pipenv等等。 阅读全文
posted @ 2020-09-06 22:49 LCdre 阅读(1028) 评论(0) 推荐(0) 编辑
摘要: 1. pipx github: https://github.com/pipxproject/pipx documentation: https://pipxproject.github.io/pipx/installation/ 1.1 简介 pipx是一个可以安装运行Python Applica 阅读全文
posted @ 2020-09-06 22:33 LCdre 阅读(981) 评论(0) 推荐(0) 编辑
摘要: def log_search(self, logfile, search_content, timeout=10): import time import subprocess import select import signal import os f = subprocess.Popen([' 阅读全文
posted @ 2019-10-21 15:52 LCdre 阅读(733) 评论(0) 推荐(0) 编辑
摘要: if/else分支判断 基本结构如下: 1 // main 2 package main 3 4 import ( 5 "fmt" 6 "strconv" 7 ) 8 9 func main() { 10 var input string 11 fmt.Scanf("%s", &input) 12 阅读全文
posted @ 2017-08-30 21:59 LCdre 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 文件名&关键字&标识符 1. 所有go源码以 .go结尾 2. 标识符以字母或者下划线开头,大小写敏感:add, Add, _add _是特殊标识符,用来忽略结果 3. 保留关键字 Go程序基本结构 函数声明和注释 1. 函数声明: func 函数名字 (参数列表) (返回值列表){}func ad 阅读全文
posted @ 2017-06-21 16:28 LCdre 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 简介 Go语言是一种新的语言,一种并发的、带垃圾回收的、快速编译的语言。它具有以下特点: 1.它可以在一台计算机上用几秒钟的时间编译一个大型的Go程序。 2.Go语言为软件构造提供了一种模型,它使依赖分析更加容易,且避免了大部分C风格include文件与库的开头。 3.Go语言是静态类型的语言,它的 阅读全文
posted @ 2017-06-12 14:40 LCdre 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 私有Docker Registry的部署和配置 从Docker Hub上可以获取官方的Registry的镜像,Registry 默认的对外服务端口是 5000,如果我们宿主机上运行的 Registry 需要对外提供服务,可以通过映射端口的方式提供。 验证 1 如果/var/lib/registry映 阅读全文
posted @ 2017-03-08 16:54 LCdre 阅读(5203) 评论(0) 推荐(0) 编辑
摘要: Dockerfile 基本框架 Dockerfile一般包含下面几个部分: 其中FROM指定基础镜像,如果镜像名称中没有制定TAG,默认为latest。RUN命令默认使用/bin/sh Shell执行,默认为root权限。如果命令过长需要换行,需要在行末尾加\。CMD命令也是默认在/bin/sh中执 阅读全文
posted @ 2017-02-23 17:56 LCdre 阅读(1005) 评论(0) 推荐(0) 编辑