会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
小鲨鱼2018
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
152
153
154
155
156
157
158
159
160
···
403
下一页
2022年11月6日
python中os模块下路径的常见操作
摘要: 001、 >>> import os >>> os.path.abspath("2.txt") ## 列出指定文件的绝对路径 '/home/test/2.txt' >>> os.path.abspath("test1") ## 列出指定目录的绝对路径 '/home/test/test1' 002、o
阅读全文
posted @ 2022-11-06 22:19 小鲨鱼2018
阅读(131)
评论(0)
推荐(0)
2022年11月4日
linux shell 中实现基本的双循环
摘要: 001、 [root@pc1 test]# ls a.sh [root@pc1 test]# cat a.sh ## 测试程序 #!/bin/bash for ((i = 1; i <= 3; i++)) do echo " outer loop:$i " for ((j = 1; j <= 3;
阅读全文
posted @ 2022-11-04 23:02 小鲨鱼2018
阅读(296)
评论(0)
推荐(0)
linux 中输出参考基因组gff文件第9列的注释类别
摘要: 001、 [root@pc1 test3]# ls GCF_000001405.40_GRCh38.p14_genomic.gff [root@pc1 test3]# awk '$3 == "gene" {split($9, a, ";"); for(i in a) {split(a[i], b,
阅读全文
posted @ 2022-11-04 18:18 小鲨鱼2018
阅读(135)
评论(0)
推荐(0)
linux 中 awk命令中数组的应用
摘要: 001、基本用法 [root@pc1 test4]# ls a.txt [root@pc1 test4]# cat a.txt a b c d b e a d e z b c a d e [root@pc1 test4]# awk '{print ay[$2]++}' a.txt 0 1 0 2 1
阅读全文
posted @ 2022-11-04 17:55 小鲨鱼2018
阅读(106)
评论(0)
推荐(0)
python 中列出指定目录下的所有文件及目录
摘要: 001、 >>> import os >>> os.listdir("/home/test") ## 结果返回的是列表 ['a.txt', 'b.txt', 'test1', 'test2', 'test3'] >>>
阅读全文
posted @ 2022-11-04 12:12 小鲨鱼2018
阅读(133)
评论(0)
推荐(0)
python 中提取文件的最后几列
摘要: 001、 [root@PC1 test]# ls a.txt test.py [root@PC1 test]# cat a.txt ## 测试文件 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019
阅读全文
posted @ 2022-11-04 12:07 小鲨鱼2018
阅读(190)
评论(0)
推荐(0)
python 中将单条scaffold的碱基序列按照指定数目输出
摘要: 001\ [root@pc1 test3]# cat a.fa >chr1 cccccggggggggttttgg cccgggggg >chr2 uuuuutttttNNNNNddffff dddgggggggggggcccccccccc [root@pc1 test3]# cat test.py
阅读全文
posted @ 2022-11-04 10:05 小鲨鱼2018
阅读(72)
评论(0)
推荐(0)
2022年11月3日
python 中 文件读取循环的坑
摘要: 001、 [root@pc1 test3]# ls a.txt b.txt test.py [root@pc1 test3]# cat a.txt 1 2 3 [root@pc1 test3]# cat b.txt 1 2 3 [root@pc1 test3]# cat test.py ## 测试程
阅读全文
posted @ 2022-11-03 15:57 小鲨鱼2018
阅读(44)
评论(0)
推荐(0)
python 中print函数实现输出不换行
摘要: 001、 [root@pc1 test3]# python2 ## python2 Python 2.7.5 (default, Jun 28 2022, 15:30:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2 Type "help",
阅读全文
posted @ 2022-11-03 15:51 小鲨鱼2018
阅读(105)
评论(0)
推荐(0)
2022年11月2日
python 中 if语句取反
摘要: 001、 >>> str1 = ">aabbcc" >>> if str1.startswith(">"): ... print("yes") ... yes >>> if not str1.startswith(">"): ## python中if语句取反 ... print("yes") ...
阅读全文
posted @ 2022-11-02 16:24 小鲨鱼2018
阅读(617)
评论(0)
推荐(0)
上一页
1
···
152
153
154
155
156
157
158
159
160
···
403
下一页
公告