上一页 1 ··· 7 8 9 10 11 12 下一页
摘要: attrib命令用来显示或更改文件属性。 ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [[drive:] [path] filename] [/S [/D]] 【+】 设置属性。 【-】清除属性。 R 只读文件属性。 A 存档文件属性。 S 系统文 阅读全文
posted @ 2020-12-09 14:39 rm-rf* 阅读(197) 评论(0) 推荐(0) 编辑
摘要: pymysql的使用bug 每次执行sql语句(增删改查)必须commit提交 当重复执行相同slq语句时,如果不commit,fetchall的结果会是上次执行的结果 或者打开pymysql的自动提交(db.autocommit(True)),但是打开自动提交后不支持事务操作。 阅读全文
posted @ 2020-12-09 14:37 rm-rf* 阅读(98) 评论(0) 推荐(0) 编辑
摘要: linux后台运行程序 nohup python3 test.py >output 2>&1 & 结果输出到output文件 nohup java -jar xxx.jar >/dev/null 2>&1 & 忽略结果 参数解释 用途:不挂断地运行命令。 语法:nohup Command [ Arg 阅读全文
posted @ 2020-12-09 14:35 rm-rf* 阅读(536) 评论(0) 推荐(0) 编辑
摘要: 最大几个数和最小几个数 import heapq a = [7, 5, 3, 4, 8, 6, 0] cc = heapq.nsmallest(2, a) #最小的两个数 dd = heapq.nlargest(3, a) #最大的三个数 print(cc) # [1, 2] print(dd) # 阅读全文
posted @ 2020-12-09 14:32 rm-rf* 阅读(547) 评论(0) 推荐(0) 编辑
摘要: 命名切片 c = slice(2, 5) a = [1, 2, 3, 4, 5, 6, 7] print(a[c]) 阅读全文
posted @ 2020-12-09 14:30 rm-rf* 阅读(102) 评论(0) 推荐(0) 编辑
摘要: git相关命令 基本操作 git init git add xxx git commit -m "first commit" git tag -a V1.0 -m '我的标签' git remote add origin git@github.com:xxx/spider.git 建立远程仓库连接 阅读全文
posted @ 2020-12-09 14:28 rm-rf* 阅读(192) 评论(0) 推荐(0) 编辑
摘要: python解析命令行参数 import click @click.command() # 使函数解析命令行 @click.option("--id", help="用户名") # 命令行添加参数 def delete(id): """ 删除用户 :param id: :return: """ cl 阅读全文
posted @ 2020-12-09 14:27 rm-rf* 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 数据可视化 使用pyecharts API文档 import math from pyecharts import options as opts from pyecharts.charts import Surface3D from pyecharts.globals import ThemeTy 阅读全文
posted @ 2020-12-09 14:26 rm-rf* 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 为什么不能用可变对象作为默认参数的值 看一个例子 def abc(a, b): b.append(a) print(b) return b if __name__ == '__main__': abc(1, []) abc(2, []) abc(3, []) 结果和预期的一样: [1] [2] [3 阅读全文
posted @ 2020-12-09 14:25 rm-rf* 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Python 表达式 i += x 与 i = i + x 等价吗? 看个例子 a = [1, 2, 3] b = a # 写法一 b += [4] # 写法二 # b = b + [4] print(id(a), a) print(id(b), b) 两种不同的写法,结果不一致 写法一结果: 23 阅读全文
posted @ 2020-12-09 14:24 rm-rf* 阅读(132) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 下一页