随笔分类 -  python

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 26 下一页
摘要:001、方法1 root@PC1:/home/test# ls test.py root@PC1:/home/test# cat test.py ## 测试程序 #!/usr/bin/python str1 = "GATATATGCATATACTT" str2 = "ATAT" result = [ 阅读全文
posted @ 2022-08-18 17:27 小鲨鱼2018 阅读(123) 评论(0) 推荐(0)
摘要:001、 root@PC1:/home/test# ls test.py root@PC1:/home/test# cat test.py ## 测试程序(起初1只兔子f[1],兔子每隔一个月有繁殖能力,没繁殖一次生3只兔子) #!/usr/bin/pyton f = [1] * 5 ## 生成一个 阅读全文
posted @ 2022-08-18 16:23 小鲨鱼2018 阅读(186) 评论(0) 推荐(0)
摘要:001、方法1 root@PC1:/home/test# ls test.py root@PC1:/home/test# cat test.py ## 测试程序 #!/usr/bin/python str1 = "GAGCCTACTAACGGGAT" ## 两天等长序列 str2 = "CATCGT 阅读全文
posted @ 2022-08-18 15:35 小鲨鱼2018 阅读(223) 评论(0) 推荐(0)
摘要:001、 >>> test1 = ["aaa", 100, 200] >>> test1 ['aaa', 100, 200] >>> test2 = [str(k) for k in test1] ## 将列表test1中的数值转换为字符串 >>> test2 ['aaa', '100', '200 阅读全文
posted @ 2022-08-18 08:27 小鲨鱼2018 阅读(512) 评论(0) 推荐(0)
摘要:001、方法1 root@PC1:/home/test# ls a.fasta test.py root@PC1:/home/test# cat a.fasta ## 测试fasta文件 >Rosalind_6404 CCTGCGGAAGATCGGCACTAGAATAGCCAGAACCGTTTCTC 阅读全文
posted @ 2022-08-18 08:17 小鲨鱼2018 阅读(123) 评论(0) 推荐(0)
摘要:001、输出最小、最大的键或者值 >>> dict1 = {"c":800, "d":600, "a":900, "b":700} >>> dict1 {'c': 800, 'd': 600, 'a': 900, 'b': 700} >>> min(dict1) ## 输出最小的键 'a' >>> 阅读全文
posted @ 2022-08-18 08:03 小鲨鱼2018 阅读(1859) 评论(0) 推荐(0)
摘要:001、方法1: root@PC1:/home/test# ls test.py root@PC1:/home/test# cat test.py ## 测试程序 #!/usr/bin/python out_file = open("result.txt", "w") str1 = "AAAACCC 阅读全文
posted @ 2022-08-18 07:29 小鲨鱼2018 阅读(227) 评论(0) 推荐(0)
摘要:001、 (base) root@PC1:/home/test4# ls test.py (base) root@PC1:/home/test4# cat test.py ## 测试程序 #!/usr/bin/python str1 = "AGCTTTTCATTCTGACTGCAACGGGCAATA 阅读全文
posted @ 2022-08-17 23:32 小鲨鱼2018 阅读(132) 评论(0) 推荐(0)
摘要:001、 capitalize将字符串的首字符转换为大写, 其余全部转换为小写 >>> str1 = "aaBBccEEff" >>> str1 'aaBBccEEff' >>> str1.capitalize() ## 将字符串首字符转换为大写, 其余全部转换为小写 'Aabbcceeff' 00 阅读全文
posted @ 2022-08-17 21:35 小鲨鱼2018 阅读(795) 评论(0) 推荐(0)
摘要:001、 (base) root@PC1:/home/test4# ls test.py (base) root@PC1:/home/test4# cat test.py ## 测试程序 #!/usr/bin/python rna = "AUGGCCAUGGCGCCCAGAACUGAGAUCAAUA 阅读全文
posted @ 2022-08-17 20:46 小鲨鱼2018 阅读(205) 评论(0) 推荐(0)
摘要:001、列出当前工作目录 >>> import os >>> os.getcwd() ## 列出当前目录 '/home/test4' 002、修改工作目录 >>> os.chdir("/home/test3/") ## 修改当前的工作目录 >>> os.getcwd() '/home/test3' 阅读全文
posted @ 2022-08-17 18:44 小鲨鱼2018 阅读(73) 评论(0) 推荐(0)
摘要:001、方法1 root@PC1:/home/test# ls a.fasta test.py root@PC1:/home/test# head -n 5 a.fasta ## 参考基因组文件 >NC_056054.1 Ovis aries strain OAR_USU_Benz2616 bree 阅读全文
posted @ 2022-08-17 07:56 小鲨鱼2018 阅读(250) 评论(0) 推荐(0)
摘要:001、方法1 root@PC1:/home/test# ls a.txt test.py root@PC1:/home/test# cat a.txt ## 测试数据 #chromosome nc_accession gene gene_id ccds_id ccds_status cds_str 阅读全文
posted @ 2022-08-16 23:18 小鲨鱼2018 阅读(179) 评论(0) 推荐(0)
摘要:001、 >>> test = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] ## 测试列表 >>> test ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h 阅读全文
posted @ 2022-08-16 18:39 小鲨鱼2018 阅读(2499) 评论(0) 推荐(0)
摘要:001、 root@PC1:/home/test# ls a.fasta target.txt test.py root@PC1:/home/test# cat test.py ## 测试程序 #!/usr/bin/python in_file = open("a.fasta", "r") targ 阅读全文
posted @ 2022-08-15 18:32 小鲨鱼2018 阅读(63) 评论(0) 推荐(0)
摘要:001、 方法1 root@PC1:/home/test# ls a.fasta test.py root@PC1:/home/test# cat test.py ## 测试程序 #!/usr/bin/python in_file = open("a.fasta", "r") dict1 = dic 阅读全文
posted @ 2022-08-15 18:17 小鲨鱼2018 阅读(61) 评论(0) 推荐(0)
摘要:001、 root@PC1:/home/test# ls a.fasta test.py root@PC1:/home/test# cat test.py ## 测试程序 #!/usr/bin/python in_file = open("a.fasta", "r") dict1 = dict() 阅读全文
posted @ 2022-08-15 18:04 小鲨鱼2018 阅读(116) 评论(0) 推荐(0)
摘要:001、 root@PC1:/home/test# ls a.fasta test.py root@PC1:/home/test# cat test.py ## 测试程序 #!/usr/bin/python in_file = open("a.fasta", "r") dict1 = {} for 阅读全文
posted @ 2022-08-15 17:58 小鲨鱼2018 阅读(125) 评论(0) 推荐(0)
摘要:001、 root@PC1:/home/test# ls a.fasta test.py root@PC1:/home/test# cat test.py ## 测试程序 #1/usr/bin/python in_file = open("a.fasta", "r") dict1 = dict() 阅读全文
posted @ 2022-08-15 17:46 小鲨鱼2018 阅读(117) 评论(0) 推荐(0)
摘要:001、 root@PC1:/home/test# cat test.py ## 测试程序 #!/usr/bin/python in_file = open("a.fasta", "r") dict1 = {} for i in in_file: i = i.strip() if i.startsw 阅读全文
posted @ 2022-08-15 17:27 小鲨鱼2018 阅读(132) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 26 下一页