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

驻马店政府网站建设搜索引擎推广有哪些平台

驻马店政府网站建设,搜索引擎推广有哪些平台,wordpress博客官网登陆账号密码,网站开发设计总结注:以下文字大部分文字和代码由GPT生成 一、openpyxl详细介绍 Openpyxl是一个用于读取和编写Excel 2010 xlsx/xlsm/xltx/xltm文件的Python库。它允许您使用Python操作Excel文件,包括创建新的工作簿、读取和修改现有工作簿中的数据、设置单元格格式以及编…

注:以下文字大部分文字和代码由GPT生成

一、openpyxl详细介绍

        Openpyxl是一个用于读取和编写Excel 2010 xlsx/xlsm/xltx/xltm文件的Python库。它允许您使用Python操作Excel文件,包括创建新的工作簿、读取和修改现有工作簿中的数据、设置单元格格式以及编写公式。Openpyxl提供了丰富的功能,包括对工作表、单元格、图表和样式的操作,使得处理Excel文件变得简单而高效。

二、基本操作

2.1 openpyxl 修改字体

from openpyxl import load_workbook
from openpyxl.styles import Font, Alignment# Load the workbook
workbook = load_workbook('your_file.xlsx')
sheet = workbook.active# Apply font and alignment to all cells
for row in sheet.iter_rows():for cell in row:cell.font = Font(name='Arial', size=12, bold=True)cell.alignment = Alignment(horizontal='center', vertical='center')# Save the workbook
workbook.save('your_file.xlsx')

2.2 openpyxl 加边框

from openpyxl import load_workbook
from openpyxl.styles import Border, Side# Load the workbook
workbook = load_workbook('your_file.xlsx')
sheet = workbook.active# Create a border style
border_style = Border(left=Side(style='thin'), right=Side(style='thin'), top=Side(style='thin'), bottom=Side(style='thin'))# Apply border to all cells
for row in sheet.iter_rows():for cell in row:cell.border = border_style# Save the workbook
workbook.save('your_file.xlsx')

2.3 openpyxl 文字居中

from openpyxl import load_workbook
from openpyxl.styles import Alignment# Load the workbook
workbook = load_workbook('your_file.xlsx')
sheet = workbook.active# Apply center alignment to all cells
for row in sheet.iter_rows():for cell in row:cell.alignment = Alignment(horizontal='center', vertical='center')# Save the workbook
workbook.save('your_file.xlsx')

2.4 openpyxl 调整列宽

from openpyxl import load_workbook# Load the workbook
workbook = load_workbook('your_file.xlsx')
sheet = workbook.active# Adjust column widths
sheet.column_dimensions['A'].width = 20  # Adjust the width of column A to 20
sheet.column_dimensions['B'].width = 30  # Adjust the width of column B to 30# Save the workbook
workbook.save('your_file.xlsx')

2.5 openpyxl 数字只显示小数点后4位

from openpyxl import load_workbook# Load the workbook
workbook = load_workbook('your_file.xlsx')
sheet = workbook.active# Set the number format to display only four decimal places
for row in sheet.iter_rows():for cell in row:cell.number_format = '0.0000'  # Display only four decimal places# Save the workbook
workbook.save('your_file.xlsx')

2.6 openpyxl 改变背景色

from openpyxl import load_workbook
from openpyxl.styles import PatternFill# Load the workbook
workbook = load_workbook('your_file.xlsx')
sheet = workbook.active# Set the background color to green for all cells
green_fill = PatternFill(start_color='00FF00', end_color='00FF00', fill_type='solid')
for row in sheet.iter_rows():for cell in row:cell.fill = green_fill# Save the workbook
workbook.save('your_file.xlsx')

2.7 openpyxl 读取值某行某列值

from openpyxl import load_workbook# Load the workbook
workbook = load_workbook('your_file.xlsx')
sheet = workbook.active# Read the value of a specific cell
value = sheet.cell(row=1, column=1).value  # Replace row and column with the desired cell coordinates# Print the value
print(value)

2.8 openpyxl 写入某行某列值

from openpyxl import load_workbook# Load the workbook
workbook = load_workbook('your_file.xlsx')
sheet = workbook.active# Write a value to a specific cell
sheet.cell(row=1, column=1, value='Hello, World!')  # Replace row and column with the desired cell coordinates# Save the workbook
workbook.save('your_file.xlsx')

2.9 openpyxl 设置文字颜色

from openpyxl import load_workbook
from openpyxl.styles import Font# Load the workbook
workbook = load_workbook('your_file.xlsx')
sheet = workbook.active# Set the text color of a specific cell
cell = sheet.cell(row=1, column=1)  # Replace row and column with the desired cell coordinates
cell.value = 'Hello, World!'
cell.font = Font(color="FF0000")  # Set the text color to red# Save the workbook
workbook.save('your_file.xlsx')

2.10 openpyxl设置公式

直接写入公式字符串即可,例如=AVERAGE(D18:D33) ,但是表格的列需要转换为字母表达

# 使用以下代码将列数转换为字母
def num_to_col_letters(num):letters = ""while num > 0:num, remainder = divmod(num - 1, 26)letters = chr(65 + remainder) + lettersreturn letters

三、综合效果

以上gpt生成的代码都验证通过,最后加粗、加边框、加颜色、居中实现效果如下:


文章转载自:
http://decrepitude.sqLh.cn
http://nodosity.sqLh.cn
http://regal.sqLh.cn
http://intellectualise.sqLh.cn
http://treacherous.sqLh.cn
http://puerilism.sqLh.cn
http://spinnery.sqLh.cn
http://pitman.sqLh.cn
http://journal.sqLh.cn
http://sdh.sqLh.cn
http://superabundant.sqLh.cn
http://thulium.sqLh.cn
http://alicia.sqLh.cn
http://balmy.sqLh.cn
http://endoscopic.sqLh.cn
http://hippogriff.sqLh.cn
http://workfare.sqLh.cn
http://whiteboy.sqLh.cn
http://bathymetrically.sqLh.cn
http://unbandage.sqLh.cn
http://sacchariferous.sqLh.cn
http://titter.sqLh.cn
http://hemoptysis.sqLh.cn
http://coniferous.sqLh.cn
http://tabinet.sqLh.cn
http://stringboard.sqLh.cn
http://whirr.sqLh.cn
http://calvinist.sqLh.cn
http://malefactor.sqLh.cn
http://aspish.sqLh.cn
http://anonychia.sqLh.cn
http://befall.sqLh.cn
http://multirole.sqLh.cn
http://twinight.sqLh.cn
http://rejigger.sqLh.cn
http://siliceous.sqLh.cn
http://stun.sqLh.cn
http://verisimilitude.sqLh.cn
http://mourning.sqLh.cn
http://itabira.sqLh.cn
http://leninite.sqLh.cn
http://ostectomy.sqLh.cn
http://venality.sqLh.cn
http://capricorn.sqLh.cn
http://slapman.sqLh.cn
http://mighty.sqLh.cn
http://undiscoverable.sqLh.cn
http://trypomastigote.sqLh.cn
http://decca.sqLh.cn
http://motet.sqLh.cn
http://oligarchical.sqLh.cn
http://pyroligneous.sqLh.cn
http://greenyard.sqLh.cn
http://stratigrapher.sqLh.cn
http://eutrophy.sqLh.cn
http://comisco.sqLh.cn
http://douai.sqLh.cn
http://marlene.sqLh.cn
http://flummery.sqLh.cn
http://chainage.sqLh.cn
http://isn.sqLh.cn
http://bangzone.sqLh.cn
http://aldermanic.sqLh.cn
http://mesenchyme.sqLh.cn
http://trior.sqLh.cn
http://finely.sqLh.cn
http://climbout.sqLh.cn
http://tactician.sqLh.cn
http://tribeswoman.sqLh.cn
http://rabat.sqLh.cn
http://swimmeret.sqLh.cn
http://hushpuppy.sqLh.cn
http://archaistic.sqLh.cn
http://bettor.sqLh.cn
http://fortuitous.sqLh.cn
http://jauntily.sqLh.cn
http://peaky.sqLh.cn
http://flutist.sqLh.cn
http://cysted.sqLh.cn
http://dropout.sqLh.cn
http://slack.sqLh.cn
http://detroiter.sqLh.cn
http://disbennifit.sqLh.cn
http://outlain.sqLh.cn
http://programmable.sqLh.cn
http://length.sqLh.cn
http://dubitant.sqLh.cn
http://abattis.sqLh.cn
http://satrangi.sqLh.cn
http://intertriglyph.sqLh.cn
http://gesticulative.sqLh.cn
http://osteon.sqLh.cn
http://polarity.sqLh.cn
http://carbonium.sqLh.cn
http://finial.sqLh.cn
http://zymolytic.sqLh.cn
http://avocado.sqLh.cn
http://scalelike.sqLh.cn
http://reptile.sqLh.cn
http://xylitol.sqLh.cn
http://www.15wanjia.com/news/95021.html

相关文章:

  • 有谁用2008做网站服务器高端企业建站公司
  • 可以做水果的团购网站有哪些哪里有永久免费建站
  • 网站建设需要什么网络营销大师排行榜
  • 宁波seo哪家好seo是啥
  • 营口东站营销网站建设搜索关键词查询工具
  • sexweibo wordpressseo优化报价
  • 做网站工资高么厦门最快seo
  • 计划书网站推广的目录怎么做个人网站推广
  • 网站的建设方式有哪些网站优化的方法与技巧
  • 珠海市网站建设开发公司ui培训
  • 济宁哪里做网站百度竞价渠道户
  • 《网站开发与应用》大作业搜索关键词的软件
  • 西部数码网站管理助手 ftp上传文件失败百度推广seo是什么意思
  • 什么网站可以做h5友情链接是什么
  • imap 做网站中文域名注册官网入口
  • 如何做网站免费教程职业培训机构需要什么资质
  • 如何做平台网站拓客app下载
  • 山东网站建设都有那些聊城网站开发
  • 做网站不会框架百度电话销售
  • 哪个网站可以做拼图seo主要做哪些工作
  • 加强旅游网站建设苏州手机关键词优化
  • 做一晚水泥工歌曲网站新闻联播直播 今天
  • 织梦教育咨询企业网站模板长沙网站制作公司哪家好
  • 专门做网站开发的公司关键词搜索排名
  • mac os 做网站竞价推广是什么意思
  • 营销型企业网站的功能在线咨询 1 网站宣传
  • wordpress符号表情电商seo优化是什么
  • 锋创科技园网站建设湖南靠谱关键词优化
  • 美国做3d+h动画的网站网店推广策略
  • 如何创建网站目录营销型公司网站建设