Hello World!
Create simple supervisely app with GUI
Last updated
Was this helpful?
Create simple supervisely app with GUI
Last updated
Was this helpful?
In this tutorial you will learn how to create Supervisely apps with GUI on pure python using Supervisely app engine and widgets. We will create a simple "Hello, World!" app that will generate names using Text
and Button
widgets.
is just 26 lines of code.
Install latest version to have access to all and library for names generation
Step 1. Prepare ~/supervisely.env
file with credentials.
Step 2. Clone with source code.
Step 3 Open repository directory in Visual Studio Code.
Step 4 Create
Step 5. Open the .vscode/launch.json
file in the project and specify the path to your script in launching configuration arguments.
Go to Run and Debug
section (Ctrl+Shift+D)
.
Select configuration name Uvicorn
that you specified in launch.json
from configuration dropdown.
Press green play button or F5
to start debugging.
Init API for communicating with Supervisely instance. First, we load environment variables with credentials:
Text
and Button
widgets.Prepare a layout for app using Card
widget with the content
parameter and place 2 widgets that we've just created in the Container
widget. Place order in the Container
is also important, we want the "hello text" to be above the name generation button.
Create an app object with layout parameter.
Use the decorator as shown below to handle button click. When we change hello_msg.text
value, data will be pushed to web browser via web sockets.
Step 6. Start debugging :