代码改变世界

随笔档案-2021年2月27日

python 使用pymysql上传excel数据

2021-02-27 22:09 by ttym88m, 261 阅读, 收藏,
摘要: from django.shortcuts import render, HttpResponsefrom Day72bbs.settings import MEDIA_ROOTfrom docxtpl import DocxTemplateimport osimport xlrd MEDIA_RO 阅读全文

python 批量打印word文档

2021-02-27 17:17 by ttym88m, 395 阅读, 收藏,
摘要: 1.pip install pypiwin32 安装模块 2.创建类:printers.py import tempfileimport win32apiimport win32printdef printer_loading(filename): open(filename, "r") win32 阅读全文

python 批量打印word文档

2021-02-27 15:57 by ttym88m, 757 阅读, 收藏,
摘要: 1.在settings.py 文件中。加入如下语句 MEDIA_URL='/doctemplates/' #模板的路径名称MEDIA_ROOT = os.path.join(BASE_DIR, 'doctemplates')#模板的路径2.在工程下面建立 doctemplates 文件夹。用于存放模 阅读全文

Python Django 使用数据库中的视图

2021-02-27 15:38 by ttym88m, 294 阅读, 收藏,
摘要: 1.在AppDatabaseViews项目中,创建 mysqlviews.py模块。模块中的内容如下:from AppDatabaseViews.models import * # #AppDatabaseViews 是项目工程 class viewsbookandpublish(models.Mo 阅读全文