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

制作一个网站平台需要多少钱小公司企业简介300字

制作一个网站平台需要多少钱,小公司企业简介300字,wordpress自动水印,互联网服务平台单位机动车二维码一般的贸易或者货运型公司#xff0c;经常需要做发票#xff0c;有时候我们会遇到需要做大批量重复性的发票时#xff0c;如果人工一个个去做#xff0c;即耗时而且容易出错#xff0c;这时我们可以用的python和excel相关的模块去批量生成。 现在有这样一个场景#xff…一般的贸易或者货运型公司经常需要做发票有时候我们会遇到需要做大批量重复性的发票时如果人工一个个去做即耗时而且容易出错这时我们可以用的python和excel相关的模块去批量生成。 现在有这样一个场景有个excel的货运发票模板invoice GIL.xls然后需要做多个发票名称不一样收货人不一样的多个发票。这时我们可以定义新的发票名称为 invoice_noGIL.xlsinvoice_no为变量发票内部需要更新 invoice_no、name两个变量 所以我们可以定义两个函数一个是获取invoice_no、name的函数 get_excel_data(packing_file)通过excel文件packing_file获取。很简单的就是通过xlrd模块获取 invoice_no、name放置在一个二维列表中我们也可以其他方式获取 # 获取发票需要的动态参数第3行第2列发票号invoice第3行第8列姓名name def get_excel_data(packing_file):data xlrd.open_workbook(packing_file)table data.sheets()[0]nrows table.nrowsnum 0data []for i in range(2, nrows):row []invoice_no table.cell_value(i, 1)name table.cell_value(i, 7)if invoice_no !:num num 1row.append(invoice_no)row.append(name)data.append(row)print(总发票数量,num)return data 另外需要一个函数 去更新发票模板中对应位置的nvoice_no、name def make_excel(invoice_no,name):width 256 * 8 # 8个字符宽# 字体和格式font xlwt.Font()font.height 240 # 12号字体font.bold Truefont.name Times New Romanstyle xlwt.XFStyle()style.font fontinvoice F:\pythonFile\\ invoice_no invoice_namedata xlrd.open_workbook(sample_file,formatting_infoTrue)new_excel copy(data)ws new_excel.get_sheet(0) # 获取第一个sheetfirst_col ws.col(0) # 第一列first_col.widthwidth # 第一列宽ws.write(7, 1, name,style) # B8(7,1)ws.write(8, 5, invoice_no,style) # F9(8,5)new_excel.save(invoice)这里用到了xlutils模块复制一份发票模板的数据注意下面的一个参数表示全部复制模板的信息包括样式 formatting_infoTrue 此外有width、font、height、bold、style等等关于excel字体单元格信息等配置 最后做发票就可以了 def mk_invoices():packing_file F:\pythonFile\\packing.xlsxdata get_excel_data(packing_file) # 获取所需参数for info in data:invoice_no info[0]name info[1]print(invoice_no,name)make_excel(invoice_no, name) 大多数时候发票里面的内容非常复杂各种格式都有执行会报错 这个时候需要对UnicodeUtils.py 进行修改一下就可以了其中黄色部分是旧的 完整代码 #作者cacho_37967865 #博客https://blog.csdn.net/sinat_37967865 #文件pymysqlModel.py #日期2018-10-22 #备注pip install pymysql pymysql是Python中操作MySQL的模块 F:\python_env\PaChong_env import xlrd import xlwt from xlutils.copy import copysample_file F:\pythonFile\\invoice GIL.xls invoice_name GIL.xls# 发票模板需要修改的地方动态 def invoice():data xlrd.open_workbook(sample_file)table data.sheets()[0]a table.cell_value(7, 1)b table.cell_value(8, 5)print(a,b)# 获取发票需要的动态参数第3行第2列发票号invoice第3行第8列姓名name def get_excel_data(packing_file):data xlrd.open_workbook(packing_file)table data.sheets()[0]nrows table.nrowsnum 0data []for i in range(2, nrows):row []invoice_no table.cell_value(i, 1)name table.cell_value(i, 7)if invoice_no !:num num 1row.append(invoice_no)row.append(name)data.append(row)print(总发票数量,num)return data# TypeError: descriptor decode requires a bytes object but received a NoneType # F:\python_env\PaChong_env\lib\site-packages\\xlwt\UnicodeUtils.py def make_excel(invoice_no,name):width 256 * 8 # 8个字符宽# 字体和格式font xlwt.Font()font.height 240 # 12号字体font.bold Truefont.name Times New Romanstyle xlwt.XFStyle()style.font fontinvoice F:\pythonFile\\ invoice_no invoice_namedata xlrd.open_workbook(sample_file,formatting_infoTrue)new_excel copy(data)ws new_excel.get_sheet(0) # 获取第一个sheetfirst_col ws.col(0) # 第一列first_col.widthwidth # 第一列宽ws.write(7, 1, name,style) # B8(7,1)ws.write(8, 5, invoice_no,style) # F9(8,5)new_excel.save(invoice)def mk_invoices():packing_file F:\pythonFile\\packing.xlsxdata get_excel_data(packing_file) # 获取所需参数for info in data:invoice_no info[0]name info[1]print(invoice_no,name)make_excel(invoice_no, name)if __name__ __main__:mk_invoices()
http://www.huolong8.cn/news/399234/

相关文章:

  • 网站建设方案及报wordpress二维码动态图片大小
  • 唐山网站建设价格wordpress评论后不显示
  • 建设网站需要多少费用重庆市建设政务中心网站
  • 网站维护的内容有哪些重庆建站网络公司
  • 从做网站可以用现在的名称吗wordpress lay
  • 太仓手机网站建设价格用tomcat做网站目录
  • 阿里巴巴专门做外贸的网站济南网站建设联系方式
  • wp网站模板无极app下载最新版
  • 网站搭建上海直播开放平台抖音
  • 南宁怎么做网站复兴企业做网站推广
  • 济南网站建设哪家好蒙文网站建设
  • qq登录网站授权怎么做网站建设xs029
  • 优化网站建设人员组成彩票网站建设应该要注意哪些
  • 网站建设需求文档编写目的洛阳网站建设哪家便宜
  • 网站建设 前后台目录结构东莞抖音推广
  • 自己公司的网站怎么编辑器国际新闻大事
  • 学校诗歌网站建设怎么开一个无货源网店
  • 甘南北京网站建设论坛网站太难做没人
  • 青岛海川建设集团网站wordpress主题注册验证码
  • 网站解封原因广州市移动网站建设服务公司
  • 什么是网站优化主要包括那几个企业所得税怎么算300万以上
  • wordpress博客网站多少钱项目信息网站哪个好
  • androidapp开发入门网站优化合同
  • 沧浪网站建设wordpress 不能换行
  • 郑州网站建设方案报价网站 做实名认证
  • 营销型网站设计价格wordpress网页版入口看文
  • 铁岭免费网站建设中装建设千股千评
  • siteground建站教程东莞网站建设php方案
  • dedecms网站地图自己怎么做网站购买空间
  • 重庆网站免费优化设计公司网站页面设计