上一页 1 ··· 78 79 80 81 82 83 84 85 86 ··· 367 下一页
摘要: 001、python报错 >>> dict1 = {"aa":300, "bb":500, "cc":400, "dd":700} >>> dict1 {'aa': 300, 'bb': 500, 'cc': 400, 'dd': 700} >>> dict1.keys() dict_keys([' 阅读全文
posted @ 2023-06-02 13:05 小鲨鱼2018 阅读(487) 评论(0) 推荐(0) 编辑
摘要: 001、python报错如下: >>> dict1 = {"aa":700, "bb":400, "cc":300, "dd":600} >>> dict1.values().index(300) Traceback (most recent call last): File "<stdin>", 阅读全文
posted @ 2023-06-02 12:58 小鲨鱼2018 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 001、 >>> dict1 = {"aa":500, "bb":400, "cc":700, "dd":300} >>> dict1 {'aa': 500, 'cc': 700, 'dd': 300, 'bb': 400} >>> dict1.keys()[dict1.values().index 阅读全文
posted @ 2023-06-02 00:27 小鲨鱼2018 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 001、 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 [root@PC1 test]# sed 's/ /tag/2' 阅读全文
posted @ 2023-06-01 15:45 小鲨鱼2018 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 两者都返回首次匹配字符串的索引,re.match函数只从头开始匹配, re.search函数不限制只从头开始匹配。 001、re.match函数 [root@PC1 test2]# python3 Python 3.10.9 (main, Mar 1 2023, 18:23:06) [GCC 11. 阅读全文
posted @ 2023-05-31 13:03 小鲨鱼2018 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 001、判断文件是否存在 (base) [root@PC1 test4]# ls a.txt dir01 (base) [root@PC1 test4]# if [ -e a.txt ]; then echo "exist"; fi ## 判断文件是否存在 exist (base) [root@PC 阅读全文
posted @ 2023-05-31 08:41 小鲨鱼2018 阅读(4841) 评论(0) 推荐(0) 编辑
摘要: 001、代码 dat <- c(3, 8, 2, 9, 4) k <- barplot(dat, axes = FALSE, ylim = c(-4, 10) ,names.arg = FALSE) axis(2, at = seq(0, 10, 2)) label <- paste0("label 阅读全文
posted @ 2023-05-31 00:33 小鲨鱼2018 阅读(692) 评论(0) 推荐(0) 编辑
摘要: 001、将所有的小写字母转换为大写 [root@PC1 test4]# ls a.txt [root@PC1 test4]# cat a.txt ## 测试数据 abd mnj uyr XDE THR QYE cvb Ddg gyi [root@PC1 test4]# sed 's/[a-z]/\U 阅读全文
posted @ 2023-05-30 21:29 小鲨鱼2018 阅读(630) 评论(0) 推荐(0) 编辑
摘要: 001、 [root@PC1 test3]# ls test1 test2 [root@PC1 test3]# tree ## 测试数据 . ├── test1 │ └── a.txt └── test2 └── b.txt 2 directories, 2 files [root@PC1 test 阅读全文
posted @ 2023-05-30 16:42 小鲨鱼2018 阅读(1718) 评论(0) 推荐(0) 编辑
摘要: 001、 [root@PC1 test4]# ls a.txt [root@PC1 test4]# cat a.txt ## 测试数据 aa bb cc dd kk jj ee uu rr [root@PC1 test4]# sed -n l a.txt aa bb cc$ dd\tkk\tjj$ 阅读全文
posted @ 2023-05-29 00:47 小鲨鱼2018 阅读(77) 评论(0) 推荐(0) 编辑
上一页 1 ··· 78 79 80 81 82 83 84 85 86 ··· 367 下一页