BT.set_env
BT.set_env
Function
writes to the BT runtime environment variable overlay.
Syntax
BT.set_env(name, value)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| name | String | Yes | None | Environment variable name. |
| value | Any | No | '' | Environment variable value, converted to string before writing. |
Return Value
| Type | Description |
|---|---|
| String/Empty | Returns the valid value before writing; returns empty if it does not exist originally. |
Examples
BT.set_env('BT_MODE', 'dev') result = BT.env('BT_MODE') // Output: dev print result
Notes
- BT.set_env() only modifies the BT runtime overlay and does not call the system global environment variable writing.
- When the variable with the same name originally has a deletion mark, set_env will overwrite the deletion mark.