Untitled
from pptx import Presentation # Create a PowerPoint presentation ppt = Presentation() # Add a title slide slide = ppt.slides.add_slide(ppt.slide_layouts[0]) title = slide.shapes.title subtitle = slide.placeholders[1] title.text = "The Whispering Woods" subtitle.text = "A Short Story" # Add a content slide for the story slide = ppt.slides.add_slide(ppt.slide_layouts[1]) title = slide.shapes.title title.text = "The Story Begins" content = slide.placeholders[1] content.text = ( "In the small village of Ravenshollow, there was a legend that kept children indoors after sunset. " "The Whispering Woods, a sprawling forest on the village's edge, was said to come alive at night. " "The trees would murmur secrets, and the shadows would move as though alive." ) # Add more slides to break the story into parts story_parts = [ "Twelve-year-old Elara didn’t believe in the old tales. She was curious, brave, and determined to uncover the truth. " "One moonlit night, armed with only a lantern and her late father’s compass, she slipped past the village gates and ventured into the woods.", "At first, it was peaceful. The air smelled of pine, and the stars peeked through the canopy above. But soon, the whispers began—soft at first, like a breeze. Then, clearer.\n\n“Elara...”", "Her heart pounded. How did the forest know her name? She turned, and a shadow shifted in the corner of her eye. She followed it, each step echoing in the stillness, until she stumbled into a clearing. " "In the center stood an ancient tree, its gnarled roots forming a throne-like structure.", "Sitting on it was a figure cloaked in darkness. “Why have you come, child of Ravenshollow?” the figure asked, its voice both soothing and ominous.\n\n“I want to know the truth about the woods,” Elara said, her voice trembling.", "The figure chuckled, a sound like rustling leaves. “The truth is, these woods are alive. We protect your village from the darkness beyond. But curiosity has a cost.”", "Before Elara could react, the figure stretched out a hand. A tendril of shadow curled around her wrist, and suddenly, she understood. The forest’s power was tied to a guardian—one who could never leave. The whispers were not warnings but invitations.", "Years later, the villagers would tell of a new legend: a glowing figure seen in the woods, her whispers guiding lost travelers back to safety. " "Elara had become part of the forest, bound to its secrets forever." ] for part in story_parts: slide = ppt.slides.add_slide(ppt.slide_layouts[1]) title = slide.shapes.title title.text = "The Whispering Woods" content = slide.placeholders[1] content.text = part # Save the presentation file_path = "/mnt/data/The_Whispering_Woods.pptx" ppt.save(file_path) file_path
Leave a Comment