上一页 1 ··· 116 117 118 119 120 121 122 123 124 ··· 408 下一页
摘要: 001、 [root@PC1 test03]# a=100 [root@PC1 test03]# echo $a 100 [root@PC1 test03]# echo $a+500 100+500 [root@PC1 test03]# echo $[a+500] ## 中括号可以实现变量运算 60 阅读全文
posted @ 2023-06-12 15:03 小鲨鱼2018 阅读(29) 评论(0) 推荐(0)
摘要: 001、 >>> import re >>> str1 = "ab cd" >>> str1 ## 测试字符串 'ab cd' >>> re.sub(r"\s+", " ", str1) ## 将多个连续的空格压缩为空格 'ab cd' 002、 >>> str2 = "sdaaaaakyh" >> 阅读全文
posted @ 2023-06-12 14:52 小鲨鱼2018 阅读(125) 评论(0) 推荐(0)
摘要: 01、 002、解决方法 [root@PC1 test2]# conda install pandas 阅读全文
posted @ 2023-06-12 13:01 小鲨鱼2018 阅读(225) 评论(0) 推荐(0)
摘要: 001、 [root@PC1 test03]# ls a.txt [root@PC1 test03]# cat a.txt ## 测试数据 bookbookbookbook jjjj name=jack uuuuuuu 127.0.0.1 bookbook77 xxxxx.com eeebookbo 阅读全文
posted @ 2023-06-12 10:46 小鲨鱼2018 阅读(1126) 评论(0) 推荐(1)
摘要: 001、删除文件的第一列 [root@PC1 test03]# ls a.txt [root@PC1 test03]# 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 te 阅读全文
posted @ 2023-06-12 10:25 小鲨鱼2018 阅读(2334) 评论(0) 推荐(0)
摘要: 使用translate()方法进行字符串转换,通常需要先创建一个转换表。转换表可以使用Python内置的str.maketrans()方法创建,也可以手动创建一个字典来实现。 001、生成转换表 >>> table = str.maketrans("135", "QMT") ## 将1转换为Q,3转 阅读全文
posted @ 2023-06-12 01:22 小鲨鱼2018 阅读(585) 评论(0) 推荐(0)
摘要: r选项的作用表示在文件中匹配B, 然后读入a.txt的内容, 添加到B的后面 001、 (base) [root@PC1 test2]# ls a.txt b.txt (base) [root@PC1 test2]# cat a.txt 1 2 3 4 5 (base) [root@PC1 test 阅读全文
posted @ 2023-06-11 00:36 小鲨鱼2018 阅读(144) 评论(0) 推荐(0)
摘要: 001、ctrl + shift + esc 打开任务管理器, 然后1, 2 阅读全文
posted @ 2023-06-10 14:44 小鲨鱼2018 阅读(317) 评论(0) 推荐(0)
摘要: lower只对ASCII起作用。 casefold对更多的语言起作用。 001、 >>> str1 = 'ß' ## 测试字符串 >>> str1 'ß' >>> str1.lower() ## lower 'ß' >>> str1 'ß' >>> str1.casefold() ## casefo 阅读全文
posted @ 2023-06-10 00:36 小鲨鱼2018 阅读(77) 评论(0) 推荐(0)
摘要: capitalize将首个字母转换为大写, 其余单词不处理。 title将所有单词的首字符转换为大写。 001、 >>> str1 = "ab cd ef" ## 测试字符串 >>> str1 'ab cd ef' >>> str1.capitalize() ## capitalize函数 'Ab 阅读全文
posted @ 2023-06-10 00:31 小鲨鱼2018 阅读(137) 评论(0) 推荐(0)
上一页 1 ··· 116 117 118 119 120 121 122 123 124 ··· 408 下一页