I'm trying to pass 10 country names at once to my payload by converting it to list. But i'm facing problems while executing the program as list comes with [square braces] that i'm unable to remove.
How can i send an entire list without square brackets to my payload. I tried json.dumps(payload) it's still not leaving the square braces.
format of my payload
payload= {"world" :
{"continent": [
{"country": "HongKong"}
],
"planet": "earth"
}
}
my file-
file.csv
country
HongKong
USA
UK
how i expect the output to be-
payload= {"world" :
{"continent": [
{"country": "HongKong"},{"country":"USA"},
{"country":"UK"}
],
"planet": "earth"
}
}
what i'm currently getting-
payload= {"world" :
{"continent": [
{"country": ["HongKong","USA","UK"]}
],
"planet": "earth"
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…