In this quick start guide, we will write our first script in Python. getOperate provides a Python 3.11 environment.
<path>.ts
and <path>.script.yaml
This is a simple example of a script built in Python with getOperate:
+Script
. This will take you to the first step of script creation: Metadata.
path
by default.python
for this example, We provided some python boilerplate. Let’s take a look:
main
function that will be the script’s entrypoint. There are a few important things to note about the main
.
name
, maybe we can use
this later if we use this Script within a flow or app and need to pass its result on.
Ctrl
+ Enter
) to verify everything works.
You can change how the UI behaves by changing the main signature. For example,
if you add a default for the name
argument, the UI won’t consider this field
as required anymore.
Customize property
: add a regex by clicking on Pattern
to make sure users are providing a name with only alphanumeric characters: ^[A-Za-z0-9]+$
. Let’s still allow numbers in case you are some tech billionaire’s kid.