摘要: 001\ #include <stdio.h> int main(void) { int i, j, max; puts("please input two integers"); printf("i = "); scanf("%d", &i); printf("j = "); scanf("%d" 阅读全文
posted @ 2022-08-11 23:30 小鲨鱼2018 阅读(654) 评论(0) 推荐(0) 编辑
摘要: 001、 #include <stdio.h> int main(void) { int i, j; printf("i = "); scanf("%d", &i); printf("j = "); scanf("%d", &j); printf("last digit of i: %d\n", i 阅读全文
posted @ 2022-08-11 22:58 小鲨鱼2018 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 001、0在linux 中表示True? root@PC1:/home/test2# [ 3 -gt 1 ] ## 判断为真, 这$?为0, True为0?? root@PC1:/home/test2# echo $? 0 002、python 中True表示为1 >>> False + False 阅读全文
posted @ 2022-08-11 22:01 小鲨鱼2018 阅读(338) 评论(0) 推荐(0) 编辑
摘要: 001、获取反向序列 >>> myseq = 'AGCTGGCTA' >>> myseq[::-1] ## 利用切片实现 'ATCGGTCGA' >>> temp = [] >>> for i in reversed(myseq): ## 借助reversed函数实现 ... temp.append 阅读全文
posted @ 2022-08-11 21:10 小鲨鱼2018 阅读(774) 评论(0) 推荐(0) 编辑
摘要: 001、 >>> import time ## 导入time包 >>> start = time.time() ## 记录程序开始时间 >>> print("xxxxx") xxxxx >>> end = time.time() ## 记录程序结束时间 >>> print("elapsed:", e 阅读全文
posted @ 2022-08-11 20:48 小鲨鱼2018 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 001、保存为字典 (base) root@PC1:/home/test2# ls a.fastq test.py (base) root@PC1:/home/test2# cat a.fastq ## 测试fastq文件 @SRR1596091.1 HISEQ:62:C35RDACXX:2:110 阅读全文
posted @ 2022-08-11 20:33 小鲨鱼2018 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 001、 (base) root@PC1:/home/test2# ls a.fasta test.py (base) root@PC1:/home/test2# cat a.fasta ## 测试fasta文件 >gene1 myc AGCTGCCTAAGC GGCATAGCTAATCG >gen 阅读全文
posted @ 2022-08-11 19:46 小鲨鱼2018 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 001、 >>> str1 = "abeababxxxaacdx" >>> dict1 = {} >>> for i in str1: ## 利用循环结构,将字符串中每个字符出现的次数储存在字典中 ... dict1[i] = str1.count(i) ... >>> for i in dict1 阅读全文
posted @ 2022-08-11 19:39 小鲨鱼2018 阅读(1472) 评论(0) 推荐(0) 编辑
摘要: 001、 >>> str1 = "abcdabaewr" ## 测试字符串 >>> import re >>> len(re.findall("a", str1)) ## 统计a出现的次数 3 >>> len(re.findall("b", str1)) ## 统计b出现的次数 2 >>> len( 阅读全文
posted @ 2022-08-11 19:35 小鲨鱼2018 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 001、 (base) root@PC1:/home/test2# ls a.fasta test.py (base) root@PC1:/home/test2# cat a.fasta ## 测试fasta文件 >gene1 myc AGCTGCCTAAGC GGCATAGCTAATCG >gen 阅读全文
posted @ 2022-08-11 19:24 小鲨鱼2018 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 001、 (base) root@PC1:/home/test2# ls a.fasta test.py (base) root@PC1:/home/test2# cat a.fasta ## 测试fasta文件 >gene1 myc AGCTGCCTAAGC GGCATAGCTAATCG >gen 阅读全文
posted @ 2022-08-11 19:07 小鲨鱼2018 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 001、 (base) root@PC1:/home/test2# ls collective.txt (base) root@PC1:/home/test2# cat collective.txt ## 测试文件, 删除每个字符中/前的所有内容 test1/1.txt test1/2.txt te 阅读全文
posted @ 2022-08-11 16:16 小鲨鱼2018 阅读(920) 评论(0) 推荐(0) 编辑
摘要: 001、方式1 (base) root@PC1:/home/test2# ls test1 test2 test3 (base) root@PC1:/home/test2# tree . ├── test1 │ ├── 1.txt │ ├── 2.txt │ └── 3.txt ├── test2 阅读全文
posted @ 2022-08-11 15:59 小鲨鱼2018 阅读(5402) 评论(0) 推荐(0) 编辑
摘要: 001、 (base) root@PC1:/home/test2# ls ## 当前目录下三个文件夹 test1 test2 test3 (base) root@PC1:/home/test2# tree ## 使用tree命令查看 . ├── test1 │ ├── 1.txt │ ├── 2.t 阅读全文
posted @ 2022-08-11 15:48 小鲨鱼2018 阅读(1381) 评论(0) 推荐(0) 编辑
摘要: 001、 (base) root@PC1:/home/test2# ls a.txt (base) root@PC1:/home/test2# cat a.txt ## 测试数据 a b c e a d a d e a f j 3 j k r a d a a a a a a f f a e (bas 阅读全文
posted @ 2022-08-11 15:10 小鲨鱼2018 阅读(93) 评论(0) 推荐(0) 编辑
摘要: printf命令用于格式化输出 001、输出字符串 %s (base) root@PC1:/home/test2# printf "%s\n" abcde ## %s 输出字符串 abcde (base) root@PC1:/home/test2# printf "xxx--%s\n" abcde 阅读全文
posted @ 2022-08-11 14:26 小鲨鱼2018 阅读(1270) 评论(0) 推荐(0) 编辑
摘要: cmp命令用于判断两个文件是否相同 001、 (base) root@PC1:/home/test2# ls (base) root@PC1:/home/test2# seq 5 > a.txt; seq 3 > b.txt; seq 5 > c.txt ## 3个测试文件 (base) root@ 阅读全文
posted @ 2022-08-11 14:10 小鲨鱼2018 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 001、 [ -a FILE ] 如果 FILE 存在则为真。 [ -b FILE ] 如果 FILE 存在且是一个块特殊文件则为真。 [ -c FILE ] 如果 FILE 存在且是一个字特殊文件则为真。 [ -d FILE ] 如果 FILE 存在且是一个目录则为真。 [ -e FILE ] 如 阅读全文
posted @ 2022-08-11 13:51 小鲨鱼2018 阅读(345) 评论(0) 推荐(0) 编辑
摘要: -s选项; 01、文件不存在; 为假 02、文件存在,但是大小为空; 为假 03、文件存在,且大小不为空; 为真 001、 [ -s file ]:文件存在且不为0是为真。 (base) root@PC1:/home/test2# ls a.txt b.txt (base) root@PC1:/ho 阅读全文
posted @ 2022-08-11 13:46 小鲨鱼2018 阅读(821) 评论(0) 推荐(0) 编辑
摘要: 001、 (base) root@PC1:/home/test2# ls a.txt (base) root@PC1:/home/test2# cat a.txt 1 2 8 10 (base) root@PC1:/home/test2# cat -s a.txt ## 将多个连续的空行压缩为一个空 阅读全文
posted @ 2022-08-11 13:35 小鲨鱼2018 阅读(49) 评论(0) 推荐(0) 编辑