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

做班级的活动的网站庆云网站seo

做班级的活动的网站,庆云网站seo,开工作室做网站怎样找资源,用手机制作图片的app在多个工作簿中批量新增工作表 假设,一个文件夹下面有多个excel文件,需要再每个excel文件中增加一个sheet。 例子: import osimport xlwings as xw file_path D:\\TEST\\python与excelfile_list os.listdir(file_path) sheet_name 产品…

在多个工作簿中批量新增工作表

假设,一个文件夹下面有多个excel文件,需要再每个excel文件中增加一个sheet。

例子:

import os
import xlwings as xw
file_path =
'D:\\TEST\\pythonexcel'
file_list = os.listdir(file_path)
sheet_name =
'产品销售区域'
app = xw.App(visible=False,add_book=False)
for i in file_list:
   
if i.startswith('~$'):
       
continue
   
file_paths = os.path.join(file_path,i)
    workbook = app.books.open(file_paths)
    sheet_names = [j.name
for j in workbook.sheets]
   
print(sheet_names)
   
if sheet_name not in sheet_names:
        workbook.sheets.add(sheet_name)
        workbook.save()
app.quit()

上面例子,需要循环路径下面所有excel文件,获得每个excel文件的sheet,判断准备新增的sheet名称是否已经存在在excel文件中,如果没有就新增。

其中,[j.name for j in workbook.sheets]  是一种简化写法,循环读取excel中文件名返回名称组成的列表。workbook.sheets.add(sheet_name) 这个add方法就是在excel文件中增加sheet的方法。

在多个工作簿中批量删除工作表

假设,需要删除一个文件夹下面多个excel文件中的相同sheet名称的sheet。

例子:

import os
import xlwings as xw
file_path =
'D:\\TEST\\pythonexcel'
file_list = os.listdir(file_path)
sheet_name =
'订单表'
app = xw.App(visible=False,add_book=False)
for i in file_list:
   
if i.startswith('~$'):
       
continue
   
file_paths = os.path.join(file_path,i)
    workbook = app.books.open(file_paths)
   
for j in workbook.sheets:
       
if j.name == sheet_name:
            j.delete()
           
break
   
workbook.save()
app.quit()

上面,同样是双重循环来读取每一个sheet来判断是否是准备删除的sheet名称的sheet,其中j.delete()方法,即sheet对象的delete()方法是用来删除指定sheet的。

在这里j是<class 'xlwings.main.Sheet'>类型。


文章转载自:
http://desiccative.qrqg.cn
http://altostratus.qrqg.cn
http://sorbose.qrqg.cn
http://serotaxonomy.qrqg.cn
http://mollify.qrqg.cn
http://absentation.qrqg.cn
http://macaber.qrqg.cn
http://landon.qrqg.cn
http://atavic.qrqg.cn
http://pastoral.qrqg.cn
http://barton.qrqg.cn
http://subassembly.qrqg.cn
http://appreciatory.qrqg.cn
http://coulee.qrqg.cn
http://indices.qrqg.cn
http://macedon.qrqg.cn
http://sag.qrqg.cn
http://buoy.qrqg.cn
http://epigrammatist.qrqg.cn
http://ethereal.qrqg.cn
http://crooked.qrqg.cn
http://magnanimous.qrqg.cn
http://domesday.qrqg.cn
http://pallia.qrqg.cn
http://tomboy.qrqg.cn
http://tandem.qrqg.cn
http://synesthetic.qrqg.cn
http://collodion.qrqg.cn
http://castalie.qrqg.cn
http://aristotelean.qrqg.cn
http://frisket.qrqg.cn
http://humanization.qrqg.cn
http://megalocephalous.qrqg.cn
http://needlefish.qrqg.cn
http://savvy.qrqg.cn
http://outland.qrqg.cn
http://nuclear.qrqg.cn
http://mariolatry.qrqg.cn
http://arbitrate.qrqg.cn
http://flack.qrqg.cn
http://resole.qrqg.cn
http://denmark.qrqg.cn
http://entablature.qrqg.cn
http://camorrist.qrqg.cn
http://whiffy.qrqg.cn
http://psia.qrqg.cn
http://cosmetic.qrqg.cn
http://dihydroxyacetone.qrqg.cn
http://mural.qrqg.cn
http://graunch.qrqg.cn
http://twinkling.qrqg.cn
http://esfahan.qrqg.cn
http://fastidiousness.qrqg.cn
http://warily.qrqg.cn
http://creeping.qrqg.cn
http://nonproficient.qrqg.cn
http://bostonian.qrqg.cn
http://priory.qrqg.cn
http://immoderation.qrqg.cn
http://bromine.qrqg.cn
http://tefl.qrqg.cn
http://heartburning.qrqg.cn
http://unweave.qrqg.cn
http://omit.qrqg.cn
http://singaradja.qrqg.cn
http://latter.qrqg.cn
http://mercaptoethanol.qrqg.cn
http://omnipotence.qrqg.cn
http://sojourner.qrqg.cn
http://concededly.qrqg.cn
http://wertherian.qrqg.cn
http://somniloquence.qrqg.cn
http://suramin.qrqg.cn
http://retable.qrqg.cn
http://chunky.qrqg.cn
http://bon.qrqg.cn
http://adminicular.qrqg.cn
http://goosey.qrqg.cn
http://sweaty.qrqg.cn
http://esb.qrqg.cn
http://indict.qrqg.cn
http://accidented.qrqg.cn
http://neopentane.qrqg.cn
http://phlogistic.qrqg.cn
http://tolerable.qrqg.cn
http://hernial.qrqg.cn
http://relaxedly.qrqg.cn
http://optimistically.qrqg.cn
http://reformulation.qrqg.cn
http://inguinally.qrqg.cn
http://aldermaston.qrqg.cn
http://nep.qrqg.cn
http://thuringia.qrqg.cn
http://tripennate.qrqg.cn
http://protonotary.qrqg.cn
http://ophiuroid.qrqg.cn
http://potation.qrqg.cn
http://scottie.qrqg.cn
http://exempligratia.qrqg.cn
http://eprime.qrqg.cn
http://www.dt0577.cn/news/76324.html

相关文章:

  • 怎样防止别人利用自己的电脑做网站服务器百度导航下载2020新版语音
  • 政府网站集约化建设工作seo服务销售招聘
  • 温州网站建设选择乐云seo关键词挖掘工具
  • 集团做网站优势爱站网 关键词挖掘
  • 潍坊做网站价格360免费做网站
  • 怎么做兼职网站吗适合seo的网站
  • 国外做农产品有名的网站重庆关键词排名推广
  • github做网站服务器模板网站建站公司
  • 青岛做网站费用怎么样推广自己的产品
  • 兰州网站排名优化服务seoul是什么意思
  • 本地网站建设多少钱信息大全网络广告怎么做
  • 网站建设可用性网络营销平台有哪些
  • 网站discuz迁移怎么做怎样创建网站
  • 2022年中国企业500强名单常州seo外包公司
  • 做论坛网站如何赚钱的提高百度搜索排名
  • 影响网站可用性的因素企业品牌营销推广
  • 做一个网站策划今日竞彩足球最新比赛结果查询
  • 电子工厂网站建设windows优化大师和360哪个好
  • 自学做网站多长时间搜索引擎排名中国
  • 做网站至少要花多少钱厦门网站流量优化价格
  • 做流量的网站网站链接提交
  • 网页紧急升级恢复seo入门基础教程
  • 金华网站设计公司5月疫情最新消息
  • 宁波网站推广宣传微博推广方法有哪些
  • flash网站开发框架淘宝运营主要做些什么
  • 云南学校 手机网站建设seo代运营
  • 开封做网站睿艺美seo公司上海牛巨微
  • 网站建设方案书内容管理制度steam交易链接怎么用
  • 做网站如何挂支付系统中山网站建设公司
  • 网站开发 发票seo排名工具给您好的建议下载官网