![]() |
Convert php array to python list
Hello,
I'm using Python 2.7 to send a request to a third party API... it returns some data which php can print using print_r..in python if I just try to print the data returned I get ... Quote:
Code:
for item in data:Quote:
Any pointers or assistance would be greatly appreciated. Many thanks, P :D |
Update:
As a crude way of dealing with this data I tried to just split the data by , like so... Code:
split_data = data.split(',')Quote:
|
I've worked this out now, so for anyone else having a similar problem understanding the php array -> python list issue.
In actual fact the data I posted on my first post in this thread is a dictionary, as far as Python is concerned, not a list.. to itterate through this dictionary in Python I did.. Code:
for key, value in shipment.iteritems(): |
| All times are GMT +1. The time now is 07:17 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.