variable#

swordfish.variable(vars)#

Set variables with the provided values.

参数:

vars (dict) -- A dictionary where keys are variable names and values are the corresponding values to be set for those variables.

返回:

True if the variables were successfully set, False otherwise.

返回类型:

bool

示例

>>> import swordfish as sf
>>> vars_to_set = {
...     "username": "john_doe",
...     "age": 30,
...     "is_admin": True,
... }
>>> sf.variable(vars_to_set)
True