找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 3445|回复: 1

[求助] python-PPTX 如何修改新建幻灯片的大小尺寸?

1

主题

1

帖子

1

积分

贫民

积分
1
wx_GzffPxs5 发表于 2018-1-10 15:05:21 | 显示全部楼层 |阅读模式


'''创建PPT'''
from pptx import Presentation
pres = Presentation()
pres.slide_width(inches2(33.87/2.54))
pres.slide_height(Inches(19.05/2.54))
slide = pres.slides.add_slide(pres.slide_layouts[8])


输出:
Traceback (most recent call last):
  File "/Users/can/Desktop/小项目合集/自动画ppt.py", line 19, in <module>
    pres.slide_width(Inches(33.87/2.54))
TypeError: 'Emu' object is not callable


然后我尝试去安装EMU:
sudo pip install EMU

然后输出:
[Errno 1] Operation not permitted: '/tmp/pip-AH14DK-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

小白表示很头疼.......................T.T










回复

使用道具 举报

2

主题

219

帖子

219

积分

版主

Rank: 7Rank: 7Rank: 7

积分
219

热心会员默默耕耘优秀版主

剑心无痕 发表于 2018-1-11 11:52:28 | 显示全部楼层
pres.slide_width(Inches(33.87/2.54))
TypeError: 'Emu' object is not callable
报的错误是Emu对象不能调用,而不是找不到Emu模块
改为pres.slide_width = Inches(33.87/2.54) 而不是去调用函数
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表