How to delete unpopulated placeholder items using python-pptx
<p>This is very simple, but I cannot find the actual method anywhere in the documentation or otherwise. </p>

<p>I am using the python-pptx module and all I need to do is delete a single placeholder item, an empty text box, on some slides (without having to create a completely new layout just for these slides) - the closest thing to an answer is here: <a href="http://python-pptx.readthedocs.io/en/latest/user/placeholders-understanding.html" rel="nofollow">http://python-pptx.readthedocs.io/en/latest/user/placeholders-understanding.html</a> under <strong>Unpopulated vs. populated</strong> but it still does not say <em>how</em> to actually delete/remove the placeholder.</p>

<p>I've tried all the obvious methods .delete(), .remove(), etc.</p>

<p>There is no API support for this, but if you delete the text box shape element, that should do the trick. It would be something like this:</p>

<pre><code>textbox = shapes[textbox_idx]
sp = textbox.element
sp.getparent().remove(sp)
</code></pre>

<p>Using the <code>textbox</code> variable/reference after this operation is not likely to go well. But otherwise, I expect this will do the trick. </p>

python python-pptx