Python采集代码下载链接:采集代码.zip - 蓝奏云
32个VX小程序源码下载链接:https://pan.baidu.com/s/1zbdfN4xjXZF5XSiox0AFUA?pwd=ryf1
提取码:ryf1
都到这里了您就支持一下呗!谢谢老铁~~
def builder_filter_file(self,files):
"""
:param files:
:return:
"""
for file in files:
if len(self.filter_down_file)==0:
self.filter_down_file.append(str(file))
for filter_file in self.filter_down_file:
if str(file) in str(filter_file):
BaseFrame().error(filter_file + "文件存在...")
pass
else:
self.filter_down_file.append(str(file))
def builder_word(self, word_title, list_files):
"""
输出产物是word文件
:param word_title: 文件的标题
:param save_path: 文件的保存路径
:param list_files: 文件集合(单个内容)
:return:
"""
try:
file_count = len(list_files)
self.copy_file(file_count,self.save_path,word_title)
print("Create Word:"+word_title)
self.gen_passandtxt(file_count,word_title,list_files)
random_full_file_name = SpriderTools.get_word_image(self.sprider_category,6)
document = Document()
#document.add_heading(""+word_title+"", level=2)
document.add_paragraph("分享"+str(file_count)+"个"+word_title+",总有一款适合您\r\n"
"下面是文件的名字,我放了一些图片,文章里不是所有的图主要是放不下...,")
document.add_paragraph(""+str(file_count)+"个"+word_title+"下载")
document.add_paragraph("Python采集代码下载链接:https://wwgn.lanzoul.com/iKGwb0kye3wj")
#Python采集代码下载链接:采集代码.zip - 蓝奏云
document.add_picture(random_full_file_name, width=Inches(3))
ppt_tieles = ""
for files in list_files:
ppt_tieles = ppt_tieles + str(files[0]) + "\r"
document.add_paragraph(ppt_tieles)
# for files in list_files:
# try:
# document.add_paragraph(files[0])
# document.add_picture(files[1], width=Inches(3))
# except Exception as e:
# pass
random_full_file_name1 = SpriderTools.get_word_image(self.sprider_category, 6)
#document.add_picture(random_full_file_name1, width=Inches(3))
document.add_paragraph("最后送大家一首诗:")
paragraph = document.add_paragraph() # 单独控制
paragraph.add_run("山高路远坑深,\r")
paragraph.add_run("大军纵横驰奔,\r")
paragraph.add_run("谁敢横刀立马?\r")
paragraph.add_run("惟有点赞加关注大军。\r")
paragraph.bold = True # 字体加粗
file_full_path=self.file_path+os.sep+word_title+".docx"
document.save(file_full_path)
except Exception as e:
print("Create Word Fail reason:" + str(e))
@staticmethod
def get_word_image(business_name,max_index,ext_name="png"):
"""
获取word插图
:param business_name: 图片业务 名称
:param max_index: 最大序号
:return: 图片的路径
"""
try:
import random
key = str(random.randint(1, int(max_index)))
random_file_name = business_name + key + "."+ext_name
random_full_file_name = business_name+"image" + os.sep + random_file_name
return random_full_file_name
except Exception as e:
return ""
学习知识费力气,
收集整理更不易。
知识付费甚欢喜,
为咱码农谋福利。
感谢您的支持