I am trying to print the payload variable onto multiple lines. It currently prints on one line.
I am using the indent statement but it still prints on one line.
Can you help?
Step 1:
Step 2:
Step 3:
Results:
I am using the indent statement but it still prints on one line.
Can you help?
Step 1:
1 2 3 4 5 6 7 |
payload = json.dumps({ "ip-detunnel" : "No" , "name" : "DP800 Slot 1" , "vlan-tag-insertion" : "No" , "vlan-tag-remove-forward" : "Remove" , "mac-replace-header" : "No" , "mpls-label-stack" : "Pass Through" }) |
1 |
print '\n' + (json.dumps(payload, indent = 4 )) |
Results:
Output:"{\"vlan-tag-insertion\": \"No\", \"name\": \"DP800 Slot 1\", \"mpls-label-stack\": \"Pass Through\", \"vlan-tag-remove-forward\": \"Remove\", \"ip-detunnel\": \"No\", \"mac-replace-header\": \"No\"}"