我对python很陌生,有一个在PowerShell中编写的脚本,我想在python中重新创建。
在powershell中,我创建了一个哈希表:
$epBody = @{
"escalation_policy" = @{
"type" = "escalation_policy"
"name" = $epName
"escalation_rules" = @(
@{
"escalation_delay_in_minutes" = 30
"targets" = @(
@{
"id" = $userid
"type" = "user_reference"
}
)
}
)
}
}
并试图找出用python写这篇文章的最佳方式。
这就是我所拥有的(我知道这是错误的!(:
ep_payload = {
"escalation_policy": {
"type": "escalation_policy",
"name": epName,
"escalation_rules": [
{
"escalation_delay_in_minutes": 30,
"targets": [
{
"id": userid
"type": "user_reference"
}
]
}
]
}
}
我只是想不出这个的正确语法
欢呼,
"让我们吃奶奶"让我们吃吧,奶奶;Commas拯救生命!