Python Playground: Drawing with the Whiteboard Widget

Getting Started with the Whiteboard The whiteboard widget gives you a canvas to draw on. Creating one is super simple: from story import create story = create() board = story.whiteboard(width=500, height=300) await story.run() Run You can customize the size to fit your needs - just adjust the width and height parameters. Drawing Basics: Shapes and Colors Rectangles: Your Building Blocks Want to draw a rectangle? Here鈥檚 how: board = story.whiteboard(width=500, height=300) # Draw a red rectangle at (x=10, y=10) with width=100 and height=50 board....

October 19, 2024 路 3 min 路 592 words 路 Cosimo Luigi Manes

Python Playground: the Story Library - Introduction

What is a Story A Story is an interactive document similar to Jupyter Notebook. You can create a Story through the Python Playground editor by importing the story library. A Story is composed of widgets, each of which is functional to a specific use. We will now analyze the following widgets: Text Whiteboard Usage To use the library, import it as follows: from story import create Main Classes Story The main class that manages the presentation....

October 14, 2024 路 1 min 路 211 words 路 Cosimo Luigi Manes