随笔分类 -  python

1 2 3 4 5 ··· 25 下一页
摘要:001、 shell zcat ${i}_trim_1P.fastq.gz | cat - <(zcat ${i}_trim_2P.fastq.gz) | awk 'NR % 4 == 0' > ${i}_quality.txt ## 将压缩后的fastq文件合并并提取出质量值 002、python 阅读全文
posted @ 2025-02-03 09:27 小鲨鱼2018 阅读(5) 评论(0) 推荐(0) 编辑
摘要:python中实现两个文件的cat型的合并 阅读全文
posted @ 2025-02-03 00:00 小鲨鱼2018 阅读(6) 评论(0) 推荐(1) 编辑
摘要:python 中实现gz文件的解压。 001、 (base) [root@PC1 test]# ls a.txt.gz test.py (base) [root@PC1 test]# zcat a.txt.gz ## 测试的压缩文件 01 02 03 04 05 06 07 08 09 10 11 阅读全文
posted @ 2025-02-02 23:59 小鲨鱼2018 阅读(16) 评论(0) 推荐(1) 编辑
摘要:001、 (base) [b20223040323@admin1 test]$ ls SRR1770413_1.fastq SRR1770413_2.fastq test.py (base) [b20223040323@admin1 test]$ cat test.py #!/bin/env pyt 阅读全文
posted @ 2025-02-01 00:03 小鲨鱼2018 阅读(6) 评论(0) 推荐(0) 编辑
摘要:001、 >>> eval("10 + 100") ## 对字符串数值进行计算 110 >>> eval("10 - 100") -90 >>> eval("10 * 100") 1000 >>> eval("10 / 100") 0.1 >>> eval(10 / 100) ## 参数需要是字符串 阅读全文
posted @ 2024-12-10 10:40 小鲨鱼2018 阅读(10) 评论(0) 推荐(0) 编辑
摘要:001、列表转换为字符串 >>> list1 ['xxx', 'yyy', 'zzz'] >>> "".join(list1) ## 使用字符串内置函数join + 可迭代对象 'xxxyyyzzz' >>> "_".join(list1) 'xxx_yyy_zzz' 002、字符串转换为列表 >> 阅读全文
posted @ 2024-10-01 15:40 小鲨鱼2018 阅读(50) 评论(0) 推荐(0) 编辑
摘要:001、 # -*- coding: utf-8 -*-的作用是告诉python编码,默认的是ASCII编码,使用中文注释的情况下会报错,而增加# -*- coding: utf-8 -*-则程序可以正常执行 [root@pc1 test1]# ls ## 下面是两个测试程序 test01.py t 阅读全文
posted @ 2024-03-08 17:21 小鲨鱼2018 阅读(537) 评论(0) 推荐(0) 编辑
摘要:001、第一句通常为 a、#!/usr/bin/env python b、#!/usr/bin/python 首先以上两脚都是指定脚本语言的解释器,均表示 用python解释器执行下面的脚本。 a的写法比b的写法更加的健壮。 因为b把解释器写死了, 如果python的可执行程序不在/usr/bin/ 阅读全文
posted @ 2024-03-08 16:55 小鲨鱼2018 阅读(588) 评论(0) 推荐(0) 编辑
摘要:001、 方法1 >>> list1 = ["aa", "aa", "bb", "aa", "cc", "cc"] ## 测试列表 >>> list1.count("aa") ## 借助内置函数输出单个元素的次数 3 >>> set(list1) ## 利用集合去重复 {'cc', 'aa', 'b 阅读全文
posted @ 2023-11-25 22:32 小鲨鱼2018 阅读(1105) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env 告诉计算机用什么程序执行该脚本。 001、测试两个程序 [root@pc1 test]# ls ## 两个测试程序 test2.py test.py [root@pc1 test]# cat test.py ## 程序1 print('hello world') [ro 阅读全文
posted @ 2023-10-31 15:56 小鲨鱼2018 阅读(47) 评论(0) 推荐(0) 编辑
摘要:01、 [root@pc1 test1]# python3 Python 3.11.4 (main, Jul 5 2023, 14:15:25) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for mo 阅读全文
posted @ 2023-10-13 16:09 小鲨鱼2018 阅读(16) 评论(0) 推荐(0) 编辑
摘要:map函数会根据提供的函数对指定的序列做映射。 第一个参数接受一个函数名,后面的参数接受一个或多个可迭代的序列,返回的是一个集合。 001、 >>> def fun01(x): ## 测试函数 ... return x * 100 ... >>> list1 = [8, 3, 2, 7] >>> > 阅读全文
posted @ 2023-10-04 14:40 小鲨鱼2018 阅读(70) 评论(0) 推荐(0) 编辑
摘要:正则表达式其本身就是一种小型的,高度专业化的编程语言。在Python中,它被内 嵌在了re模块里面,正则表达式模式被编译成一系列的字节码,然后由用C编写的匹 配引擎执行。 001、re.search a、 >>> re.search('www', 'www.runoob.com') ## 返回了匹配 阅读全文
posted @ 2023-10-04 10:09 小鲨鱼2018 阅读(27) 评论(0) 推荐(0) 编辑
摘要:001、方法1 借助字典统计 [root@pc1 test2]# ls test.py [root@pc1 test2]# cat test.py ## 测试程序 #!/usr/bin/env python3 # -*- coding: utf-8 -*- list1 = ["aa", "bb", 阅读全文
posted @ 2023-09-30 23:26 小鲨鱼2018 阅读(398) 评论(0) 推荐(0) 编辑
摘要:001、 >>> list1 = ["aa", "bb", "cc", "dd"] ## 列表1 >>> list2 = [111, 222, 333, 444] ## 列表2 >>> list3 = [] >>> for i in range(len(list1)): ... list3.appe 阅读全文
posted @ 2023-09-29 21:42 小鲨鱼2018 阅读(190) 评论(0) 推荐(0) 编辑
摘要:001、 [root@pc1 test2]# ls test.py [root@pc1 test2]# cat test.py ## 测试程序 #!/usr/bin/env python3 # -*- coding: utf-8 -*- import re str1 = "abcdefghijklm 阅读全文
posted @ 2023-09-28 22:01 小鲨鱼2018 阅读(50) 评论(0) 推荐(0) 编辑
摘要:001、生成 nN nnNN nnnNNN .... a、 [root@pc1 test1]# ls test.py [root@pc1 test1]# cat test.py ## 测试程序 #!/usr/bin/env python3 # -*- coding: utf-8 -*- for i 阅读全文
posted @ 2023-09-28 20:46 小鲨鱼2018 阅读(28) 评论(0) 推荐(0) 编辑
摘要:001、假定数字为3 [root@pc1 test1]# ls test.py [root@pc1 test1]# cat test.py ## 测试程序 #!/usr/bin/env python3 # -*- coding: utf-8 -*- for i in range(1,4): for 阅读全文
posted @ 2023-09-28 20:25 小鲨鱼2018 阅读(46) 评论(0) 推荐(0) 编辑
摘要:001、conda基础环境 (base) [root@pc1 home]# python3 --version Python 3.11.4 (base) [root@pc1 home]# 002、退出conda base环境 (base) [root@pc1 home]# conda deactiv 阅读全文
posted @ 2023-09-15 12:09 小鲨鱼2018 阅读(548) 评论(0) 推荐(0) 编辑
摘要:001、 [root@pc1 test01]# ls a.fa test.py [root@pc1 test01]# cat a.fa ## 测试文件 ATCC GGGC ATGG AAGC TTGG ATGC ATGG [root@pc1 test01]# cat test.py ## 转置程序 阅读全文
posted @ 2023-09-12 15:25 小鲨鱼2018 阅读(22) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 25 下一页
点击右上角即可分享
微信分享提示