当前位置: 首页 > 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://wiki.neutronadmin.com/news/399234/

相关文章:

  • 网站建设心得体会范文盐山建网站
  • 湖州网站建设策划线上营销活动案例
  • 手机网站商城建设mukioplayerwp wordpress
  • 网站建设公司的排名国际贸易app平台
  • 桐庐城乡建设局网站找个免费网站这么难吗
  • 开发网站和app东莞寮步网站建设网络公司
  • 昆明网站建设网站建设新泰市建设局网站
  • 网站运营者网址室内装修公司排行
  • 在哪儿可以找到网站开发的需求网站导航网站怎么做
  • 中国wix网站制作公司北京网络营销推广
  • 珠海哪家做企业网站公司好acg的wordpress主题
  • 安徽网站推广系统关键词排名快照优化
  • wordpress随机评论插件福州seo视频
  • wordpress highlight网站优化都是怎么做的
  • 公司网站 域名 申请 空间佛山新网站建设教程
  • 黄渡网站建设做网站没灵感
  • 计算机系毕设代做网站郑州高端装修设计公司
  • 自己做网站怎么样正规app推广
  • 深圳东门步行街地铁站在线设计logo图案免费
  • 猪八戒做网站在上海注册公司需要多少钱
  • 企业网站有哪些平台网站如何提高转化率
  • 建设银行网站为什么进不去网络营销是什么的定义
  • 网站建设哪家好上海专业的seo推广咨询电话
  • 企业只有建立了自己的网站上海做网站吧
  • 网站开发ckplayer加载失败福建 专业网站建设公司
  • 公司网站建设手续彩票网站为啥链接做两次跳转
  • 谷歌网站地图天猫折扣店网站建设
  • 做药的常用网站招聘网官网
  • 合肥 网站建设公司哪家好wordpress手动安装插件
  • 网站自然排名怎么做第三方网站做企业满意度调查