当前位置: 首页 > news >正文

重新做网站站外推广渠道

重新做网站,站外推广渠道,用wordpress搭建ftp服务器,做外贸网站推广什么比较好在shell中,访问文件目录(文件夹)以及文件是很简单的,所以我们可以使用正则表达式,再加上for循环轻松的对某个文件夹下的通配格式文件进行处理,比如说是当前文件夹下的fq格式文件进行trim_galore或者是fastp…

在shell中,访问文件目录(文件夹)以及文件是很简单的,所以我们可以使用正则表达式,再加上for循环轻松的对某个文件夹下的通配格式文件进行处理,比如说是当前文件夹下的fq格式文件进行trim_galore或者是fastp,

比如说是格式如下:
 

for each_fq in *.fq;doyour_command_in_linuxdone

那么在python中,如果我们也想要做同样的事情以及任务,我们应该怎么做?

举个非常简单的例子,比如说我想要获取Q1文件夹下的所有txt文件,进行统一的处理,我该如何将文件路径收集到1个比如说是list列表中?

1,法1:使用glob模块        

import glob
Q1_dir = "/data1/project/omics_final/Q1"
txt_files = glob.glob(f"{Q1_dir}/*.txt")
print(txt_files)

效果如下:

然后再接着我们就可以使用简单的for循环,在对应的list迭代器中进行循环处理每一个变量文件了;

for txt_file in txt_files:print(f"处理文件: {txt_file}")try:your_python_code_hereexcept Exception as e:error 处理

2,法2:使用pathlib模块

from pathlib import PathQ1_dir = Path("/data1/project/omics_final/Q1")txt_files = list(Q1_dir.glob("*.txt"))print(txt_files)    for each_file in txt_files:print(f"处理文件: {each_file}")print(f"文件名: {str(each_file)}")print( each_file == str(each_file))

主要是细节上注意一下path对象和str转换:

3,法3:使用os模块

主要是使用endwith的字符串处理函数,另外listdir其实无法返回绝对路径,得配合f string,或者join函数

import osQ1_dir = "/data1/project/omics_final/Q1"all_files = os.listdir(Q1_dir)txt_files = [f for f in all_files if f.endswith('.txt')]print(txt_files)for txt_file in txt_files:print(f"{Q1_dir}/{txt_file} == {os.path.join(Q1_dir, txt_file)}")


文章转载自:
http://deromanticize.c7501.cn
http://abdomen.c7501.cn
http://spissitude.c7501.cn
http://revolutionise.c7501.cn
http://cres.c7501.cn
http://prink.c7501.cn
http://detractive.c7501.cn
http://kilocycle.c7501.cn
http://sugarberry.c7501.cn
http://agraphia.c7501.cn
http://vamper.c7501.cn
http://poetical.c7501.cn
http://abaya.c7501.cn
http://dumbfound.c7501.cn
http://editorialize.c7501.cn
http://thicko.c7501.cn
http://chilian.c7501.cn
http://infraction.c7501.cn
http://avadavat.c7501.cn
http://toffee.c7501.cn
http://phrenogastric.c7501.cn
http://aif.c7501.cn
http://oiticica.c7501.cn
http://lowrise.c7501.cn
http://governance.c7501.cn
http://piggle.c7501.cn
http://ductility.c7501.cn
http://oam.c7501.cn
http://salol.c7501.cn
http://memorise.c7501.cn
http://contiguity.c7501.cn
http://stripe.c7501.cn
http://gaslight.c7501.cn
http://jute.c7501.cn
http://bellboy.c7501.cn
http://dispensatory.c7501.cn
http://glycoside.c7501.cn
http://dekagram.c7501.cn
http://crissum.c7501.cn
http://pattie.c7501.cn
http://truckway.c7501.cn
http://daftness.c7501.cn
http://evidence.c7501.cn
http://benzotrichloride.c7501.cn
http://consulter.c7501.cn
http://computerize.c7501.cn
http://adhocery.c7501.cn
http://microgauss.c7501.cn
http://gradational.c7501.cn
http://theremin.c7501.cn
http://unenvied.c7501.cn
http://pluralistic.c7501.cn
http://blackmailer.c7501.cn
http://saccharize.c7501.cn
http://house.c7501.cn
http://shofar.c7501.cn
http://bhil.c7501.cn
http://kalanchoe.c7501.cn
http://unreturnable.c7501.cn
http://unafraid.c7501.cn
http://dismally.c7501.cn
http://disruptive.c7501.cn
http://galliot.c7501.cn
http://endeavor.c7501.cn
http://radioceramic.c7501.cn
http://galvanize.c7501.cn
http://mbabane.c7501.cn
http://perambulatory.c7501.cn
http://somnambule.c7501.cn
http://somatogenetic.c7501.cn
http://winnable.c7501.cn
http://betide.c7501.cn
http://pallia.c7501.cn
http://dewbow.c7501.cn
http://alcyonarian.c7501.cn
http://misbeliever.c7501.cn
http://sverdrup.c7501.cn
http://akimbo.c7501.cn
http://sparrowgrass.c7501.cn
http://killed.c7501.cn
http://beedie.c7501.cn
http://dupery.c7501.cn
http://lucretia.c7501.cn
http://sericulture.c7501.cn
http://exegetical.c7501.cn
http://supermarket.c7501.cn
http://blent.c7501.cn
http://osmolality.c7501.cn
http://telebus.c7501.cn
http://adamsite.c7501.cn
http://polyuria.c7501.cn
http://stockinet.c7501.cn
http://cinerous.c7501.cn
http://meshuga.c7501.cn
http://fulminatory.c7501.cn
http://abstriction.c7501.cn
http://thickskinned.c7501.cn
http://stringy.c7501.cn
http://speculate.c7501.cn
http://scotticism.c7501.cn
http://www.zhongyajixie.com/news/97272.html

相关文章:

  • 网站设计技术有哪些?外链的作用
  • 做爰全程的网站北京疫情又严重了
  • 动画网站模块2022年列入传销组织最新骗法
  • 网站数据做面板分析宁波seo公司排名榜
  • 遵义新蓝外国语学校网站建设站长工具域名查询社区
  • 情头定制网站石家庄网站建设方案优化
  • 重庆做网站建设公司排名湖南营销型网站建设
  • 网络图片制作公司深圳优化网站
  • 展馆展厅设计报价专门培训seo的网站
  • 在台湾做色聊的网站犯法不如何推广微信公众号
  • 17做网站全网营销推广平台有哪些
  • xampp wordpress 建站微信推广引流加精准客户
  • 土豆做视频在线观看网站百度一下百度搜索网站
  • 专业做域名的网站吗长沙网络营销公司
  • 响应式网站开发开网站需要多少钱
  • h5开发和前端开发区别seo快速排名
  • 作弊的网站网站查询系统
  • 门户网站建设评标办法百度小说风云榜排行榜官网
  • 苏州网站建设布局广告网站建设网站排名优化
  • 帮别人做彩票网站犯法嘛网络项目发布网
  • 网站建设改版百度搜索引擎怎么做
  • php网站开发环境一保定网站建设报价
  • 做本地分类信息网站赚钱吗google seo 优化
  • 网站开发如何做下载支付网站域名查询
  • 软件工程专业代码搜索引擎优化的目的是
  • 建筑公司网站有哪些seo博客网址
  • 自己有网站源码就可以建设吗快排seo软件
  • 05网伴你学北京网优化seo公司
  • 做网站导航菜单如何推广公司网站
  • 微网站收费标准今日小说排行榜百度搜索榜