摘要: 准备 下载链接:https://www.python.org/ftp/python/ 下载源码:wget https://www.python.org/ftp/python/2.7.16/Python-2.7.16.tgz 注意:如果替换到系统默认的的Python,会导致系统某些功能不能用,例如 y 阅读全文
posted @ 2019-12-11 13:30 duchaoqun 阅读(444) 评论(0) 推荐(0) 编辑
摘要: 拆分文件 # 每个文件的行数为1000行 split -l 1000 test.txt # 将test文件拆分,20M一个文件 split -b 20M test.txt test文件拆分,并且文件名依次为 [前缀]aa, [前缀]ab, [前缀]ac等,默认的前缀是X (使用-d选项可以指定后缀为数字,如00,01,02..,而不是aa,ab,ac。) 阅读全文
posted @ 2019-12-09 17:35 duchaoqun 阅读(729) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*- import os print(os.name) # 获取操作系统类型 # print(os.uname()) # 获取操作系统的详细信息,Win不支持 print(os.environ) # 获取操作系统环境变量,结果是一个dict print(os 阅读全文
posted @ 2019-12-06 17:48 duchaoqun 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 说明 目前大部分自由软件实现国际化使用的是gettext。 国际化就是让程序可以使用多国语言来显示程序里的字符串。 程序里一般都有很多字符串,菜单名也好,错误信息也好,都是字符串。假设字符串为string,非国际化的程序里都是直接写"string"。如果用了 gettext 来实现国际化的话,就要写 阅读全文
posted @ 2019-12-04 14:45 duchaoqun 阅读(651) 评论(0) 推荐(0) 编辑
摘要: 安装 anaconda 和 superset 下载 anaconda 软件: https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh 参考 Superset 官方文档: https://superset.apache.o 阅读全文
posted @ 2019-12-04 13:46 duchaoqun 阅读(478) 评论(0) 推荐(0) 编辑
摘要: Windows 启用长路径支持 打开注册表编辑器:regedit 找到如下路径:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSytem 找到如下键值:LongPathsEnabled 将值修改为1:默认是0,不启用。 原因 如果Wi 阅读全文
posted @ 2019-12-04 08:48 duchaoqun 阅读(3978) 评论(0) 推荐(0) 编辑
摘要: 基本用法 # -*- coding: utf-8 -*- # !/usr/bin/python # 需要安装下面的驱动包 import psycopg2 # 连接到一个现有的数据库,如果数据库不存在,那么它就会被创建,最终将返回一个数据库对象。 conn = psycopg2.connect(dat 阅读全文
posted @ 2019-12-03 09:32 duchaoqun 阅读(221) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*- import xlwt def write_excel(): f = xlwt.Workbook() fenlei = ['一类','二类','三类','四类'] data_list = [[1,2,3],[11,22,33,44],[111,222, 阅读全文
posted @ 2019-12-02 16:15 duchaoqun 阅读(1359) 评论(0) 推荐(0) 编辑
摘要: SQL - SELECT 如果一个数学表达式中包含一个空值,那么该数学表达式的结果为空值。 基本查询 select t1.col1 + 1 from t1; -- 可以直接在(数值)字段上使用运算符。 SELECT t1.col1 + 1 AS res FROM t1; -- 使用AS关键字设置别名 阅读全文
posted @ 2019-12-02 09:07 duchaoqun 阅读(113) 评论(0) 推荐(0) 编辑
摘要: netstat - 系统信息 注意:如果是勘验或者验证漏洞,需要验证netstat程序的完整性(netstat程序是否被修改过)。 # 老版本的CentOS中会自带这个软件包,新版的7有的时候需要单独安装。 yum install -y net-tools 参数 说明 -a --all Show both listening and non-listening... 阅读全文
posted @ 2019-11-30 16:01 duchaoqun 阅读(123) 评论(0) 推荐(0) 编辑