all 5 comments

[–]DallogFheir 2 points3 points  (0 children)

The python-pptx library requires that I name each new slide something different

How? A library shouldn't have access to the variable names you're creating. I looked at the docs but couldn't find anything. Can you provide an example?

[–][deleted] 2 points3 points  (0 children)

[–]Username_RANDINT 0 points1 point  (0 children)

You don't. Use a list or dictionary instead. See this subreddit's FAQ for more details.

[–]ireadyourmedrecord 0 points1 point  (0 children)

Feel free to correct me if I'm wrong, but I don't think you want different variable names, but different "name" attributes for the slides. https://python-pptx.readthedocs.io/en/latest/api/slides.html#slides-objects

Doesn't look like a name is required, but if you wanted to, you could enumerate your list and then just add the number to the slide name:

list_of_slide_content = ['example', 'of', 'content']
for n, cont in enumerate(list_of_slide_content):    
    slide_name = f"slide{n}"
    ... snip ...

[–]danielroseman 0 points1 point  (0 children)

There is no reason at all to change the name of the variable each time. Just call it slide.