Python将图像插入现有PowerPoint的中间(Python Insert Image into the middle of an existing PowerPoint)
我有一个包含20张幻灯片的PowerPoint演示文稿。 此演示文稿用作模板,每张幻灯片具有不同的背景。 我想采用这个(现有的)PowerPoint演示文稿,在幻灯片编号4中插入图像(对前3个不做任何操作)并将其另存为新的PowerPoint演示文稿。
这就是我现在所拥有的。 此代码加载现有演示文稿并将其另存为新演示文稿。 现在我只需要知道如何使用它将图像插入到如上所述的4号幻灯片中。
注意:我使用普通的Python。
from pptx import Presentation def open_PowerPoint_Presentation(oldFileName, newFileName): prs = Presentation(oldFileName) #Here I guess I need to type something to complete the task. prs.save(newFileName) open_PowerPoint_Presentation('Template.pptx', 'NewTemplate.pptx')
I have an existing PowerPoint presentation with 20 slides. This presentation serves as an template with each slide having different backgrounds. I want to take this (existing) PowerPoint presentation, insert an image in slide number 4 (do nothing with the first 3) and save it as a new PowerPoint presentation.
This is what I have up until now. This code loads an existing presentation and saves it as a new one. Now I just need to know how to use this to insert an image to slide number 4 like described above.
Note: I am using normal Python.
from pptx import Presentation def open_PowerPoint_Presentation(oldFileName, newFileName): prs = Presentation(oldFileName) #Here I guess I need to type something to complete the task. prs.save(newFileName) open_PowerPoint_Presentation('Template.pptx', 'NewTemplate.pptx')
原文:https://stackoverflow.com/questions/35848670
最满意答案
像这样的东西应该工作:
ORDER BY (fieldX = Y) DESC, whateverField ASC
Something like this should work:
ORDER BY (fieldX = Y) DESC, whateverField ASC
相关问答
更多-
这个例子很有用,也许它可以解决你的问题。 var indicesResponse = client.DeleteIndex(descriptor => descriptor.Index(indexName)); client.CreateIndex(indexName, c => c .AddMapping
(m => m .MapFromAttributes() .Properties(o => o .MultiFiel ... -
GROUP BY不关心您的订单,无论如何它都在整个数据集上运行。 GROUP BY doesn't care about your order, it's running over the whole dataset anyway.
-
用这个 : SELECT * FROM (select * from chat where To_='$NameId' OR From_='$NameId' ORDER BY DATE DESC LIMIT 0,50) sub ORDER BY DATE ASC Use this : SELECT * FROM (select * from chat where To_='$NameId' OR From_='$NameId' ORDER BY DATE DESC LIMIT 0,50) sub ORD ...
-
php mysql asc / desc命令(php mysql asc/desc order)[2020-02-13]
您的GROUP BY bookslot.b_ref正在对记录进行分组,因此您只能看到每种情况下的最后一次。 尝试使用 SELECT date, time, MIN(bookslot.id_timeslot) FROM bookslot LEFT JOIN timeslot ON bookslot.id_timeslot = timeslot.id_timeslot WHERE bookslot.status = 1 GROUP BY bookslot.b_ref ORDER BY books ... -
这是您的order by : ORDER BY prioritet ASC, id ASC, RAND() 它由prioiritet订购,然后由id订购。 你要: ORDER BY prioritet ASC, RAND() 换句话说,不要按id排序。 这假设id在每一行上都是唯一的(给定名称是合理的)。 如果id不是唯一的,则需要更复杂的查询: SELECT a.id, a.user_id, a.active, a.prioritet FROM agents a join (select i ...
-
MySQL:ORDER BY whateverField ASC [首先放行X]?(MySQL: ORDER BY whateverField ASC [with row X put first]?)[2023-02-23]
像这样的东西应该工作: ORDER BY (fieldX = Y) DESC, whateverField ASC Something like this should work: ORDER BY (fieldX = Y) DESC, whateverField ASC -
除了Asc / Desc之外,还有其他的使用Mysql Order By的方法吗?(Besides Asc/Desc, Any other way to use Mysql Order By?)[2022-08-22]
试试这个。 将类型为varchar(255)唯一编号转换为INT类型 SELECT * FROM info order by CAST(uniquenumber AS INT) ASC Try this one. Cast unique number with type varchar(255) to INT type SELECT * FROM info order by CAST(uniquenumber AS INT) ASC -
我认为最简单的方法是这样做: SELECT * FROM `mytable` ORDER BY FIND_IN_SET(id, '2,3,1') I think the easiest way is to do it like this: SELECT * FROM `mytable` ORDER BY FIND_IN_SET(id, '2,3,1')
-
您需要查询的ORDER BY子句的条件语句: ORDER BY CASE WHEN col = 'Value5' THEN 1 WHEN col = 'Value3' THEN 3 ELSE 2 END ASC, col ASC You need a conditional statement on the ORDER BY clause of your query: ORDER BY CASE WHEN col = 'Value5 ...
-
MySQL - 按日期排序ASC和DESC,具体取决于其他领域(MySQL - Order by date ASC and DESC, depending on other field)[2022-08-25]
我不确定estado是什么,但你的逻辑似乎是: ORDER BY task_type, (CASE WHEN task_type = 1 THEN task_date END) ASC, (CASE WHEN task_type = 1 THEN hour END) ASC, (CASE WHEN task_type = 1 THEN priority END) DESC, (CASE WHEN task_type = 1 THEN i ...