我们提供统一消息系统招投标所需全套资料,包括统一消息系统介绍PPT、统一消息系统产品解决方案、
统一消息系统产品技术参数,以及对应的标书参考文件,详请联系客服。
import pika
from pptx import Presentation
def callback(ch, method, properties, body):
data = body.decode('utf-8')
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[0])
title = slide.shapes.title
subtitle = slide.placeholders[1]
title.text = "自动化生成"
subtitle.text = data
prs.save("auto_generated_ppt.pptx")
print("PPT已保存!")
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='ppt_queue')
print('等待消息...')
channel.basic_consume(queue='ppt_queue', on_message_callback=callback, auto_ack=True)
channel.start_consuming()