Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pptx import Presentation
- import os
- #* Finding and opening the template file to write to
- file = os.path.dirname(os.path.realpath(__file__))
- prs = Presentation(file + '\\Template.pptx')
- #* Creating the title layout
- title_slide_layout = prs.slide_layouts[0]
- slide = prs.slides.add_slide(title_slide_layout)
- # * Creating the title object
- title = slide.shapes.title
- subtitle = slide.placeholders[1]
- # * Creating the slide layout
- mainslidelayout = prs.slide_layouts[1]
- #* Creating the different slides with the layout from mainslidelayout
- S1 = prs.slides.add_slide(mainslidelayout)
- S2 = prs.slides.add_slide(mainslidelayout)
- S3 = prs.slides.add_slide(mainslidelayout)
- S4 = prs.slides.add_slide(mainslidelayout)
- S5 = prs.slides.add_slide(mainslidelayout)
- S6 = prs.slides.add_slide(mainslidelayout)
- #* Setting the title text and subtitle
- title.text = "The Arctic Treaty"
- subtitle.text = "Generated in python because I was bored"
- #* Creating the objects for slide1
- t1 = S1.shapes.title
- sub1 = S1.placeholders[1]
- #* Seting the text for slide1
- t1.text = "What is the Antartic Treaty?"
- sub1.text = "The Antartic Treaty is a Treaty that has been signed by twelve countries (Governments of Argentina, Australia, Belgium, Chile, the French Republic, Japan, New Zealand, Norway, the Union of South Africa, the Union of Soviet Socialist Republics, the United Kingdom of Great Britain and Northern Ireland, and the United States of America) that prohibits the use of Antartica for non peaceful purposes."\
- "The Antartic Treaty allows all members of the Treaty to freely carry out scientific research in Antartica. The Antartic Treaty also forbids the assertion or ownership of land, all land is accessible by all members. Nuclear activity in Antartica is strictly prohibited to protect the wildlife there"
- #* Creating the slide2 objects
- t2 = S2.shapes.title
- sub2 = S2.placeholders[1]
- #* Slide2 text
- t2.text = "Who is involved?"
- sub2.text = "The Governments of 12 countries have signed the Treaty on the behalf of their country, these countries are: Governments of Argentina, Australia, Belgium, Chile, the French Republic, Japan, New Zealand, Norway, the Union of South Africa, the Union of Soviet Socialist Republics, the United Kingdom of Great Britain and Northern Ireland, and the United States of America."
- #* Creating slide3 objects
- t3 = S3.shapes.title
- sub3 = S3.placeholders[1]
- #* Setting slide3 text
- t3.text = "What is the aim?"
- sub3.text = "The aim of the Treaty is to protect Antartica and its inhabitants and wildlife from damage. Antartica is an incredibly large and unexplored area and scientists have yet to fully explore it. Antartica is also very unstable, this is why its so expensive to travel there."\
- "Antartica has been demilitarized, in order to comply with these rules and give all members equal power within the area."
- #* Creating the slide4 objects
- t4 = S4.shapes.title
- sub4 = S4.placeholders[1]
- #* Setting the slide4 text
- t4.text = "What are the main points?"
- sub4.text = "The main points of the Antarctic Treaty are as follows:\n-Nobody owns Antarctica \n-Antarctica can be freely accesed by all parties \n-Antarctica cannot be militarized \n-Antarctica's seas are not affected by the Treaty \n-Antarctica's stations can be freely inspected by all parties"
- #* Creating the slide 5 objects
- t5 = S5.shapes.title
- sub5 = S5.placeholders[1]
- #* Setting the slide5 text
- t5.text = "Is the Treaty good?"
- sub5.text = "I think that the Treaty is a good start, however I think that the seas surrounding Antartica should also be protected from unpermitted visitors as a lot of the Antarctic animals are being affected by the pollution given off by the scientists travelling there."
- #* Creating the slide6 object
- t6 = S6.shapes.title
- sub6 = S6.placeholders[1]
- #* Setting the slide6 text
- t6.text = "How was this powerpoint made?"
- sub6.text = "This powerpoint was not actually written in powerpoint, I wrote a script in a programming language called python to create it. Everything here has been generated from this script. A link to the script can be found here: "
- #* Saving it as Geography.pptx
- prs.save('Geography.pptx')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement