Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I am having trouble making python dictionary or list

I am very new to python and have a script that i wrote in PowerShell that I would like to recreate in python.

in powershell i have created a hashtable:

   $epBody = @{
                    "escalation_policy"   = @{
                        "type"               =   "escalation_policy"
                        "name"               =   $epName
                        "escalation_rules"   = @(
                            @{
                                "escalation_delay_in_minutes" = 30
                                "targets"                     = @(
                                    @{
                                        "id"    = $userid
                                        "type"  = "user_reference"
                                    }
                                )
                            }
                        ) 
                    }
                }

And trying to figure out the best way to write this in python.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

this is what i have (which i know is wrong!):

ep_payload = {
                "escalation_policy": {
                        "type": "escalation_policy",
                        "name": epName,
                        "escalation_rules": [
                            {
                                "escalation_delay_in_minutes": 30,
                                "targets": [
                                    {
                                        "id": userid
                                        "type": "user_reference"
                                    }
                        ]
                            }
                        ] 
                    }
                }

I just cannot figure out the correct syntax for this one

cheers,

>Solution :

"Let’s eat Grandma", "Lets eat, Grandma" Commas save lives!

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading