Re: Send array back in result from urllib2.urlopen(request, postData)

2014-01-11 Thread vanommen . robert
I understand the problem now. the echo is a string, wich can contain text but no array. I've changed the PHP script so I get only text separated with comma's and in python I separate the textfields and declare them in the array. With the split methode I saw in the answer of J. Gordon. Thank yo

Re: Send array back in result from urllib2.urlopen(request, postData)

2014-01-10 Thread MRAB
On 2014-01-10 20:57, vanommen.rob...@gmail.com wrote: Hello, I have a Raspberry Pi with 10 temperature sensors. I send the data from the sensors and some other values with json encoding and: result = urllib2.urlopen(request, postData) to a online PHP script wich places the data in a mysql dat

Re: Send array back in result from urllib2.urlopen(request, postData)

2014-01-10 Thread Denis McMahon
On Fri, 10 Jan 2014 12:57:59 -0800, vanommen.robert wrote: > Hello, > > I have a Raspberry Pi with 10 temperature sensors. I send the data from > the sensors and some other values with json encoding and: > > result = urllib2.urlopen(request, postData) > > to a online PHP script wich places the

Re: Send array back in result from urllib2.urlopen(request, postData)

2014-01-10 Thread Dave Angel
On Fri, 10 Jan 2014 12:57:59 -0800 (PST), vanommen.rob...@gmail.com wrote: No idea about the php.. In python when i do para = result.read() print para the output is: [null,null,null,null,null,"J"] That's a string that just looks like a list. This is correct according to the data in P

Re: Send array back in result from urllib2.urlopen(request, postData)

2014-01-10 Thread John Gordon
In vanommen.rob...@gmail.com writes: > result = urllib2.urlopen(request, postData) > para = result.read() > print para > the output is: > [null,null,null,null,null,"J"] > print para[1] > the output is: > n Probably because para is a string with the value '[null,null,null,null,null,"J"]'

Send array back in result from urllib2.urlopen(request, postData)

2014-01-10 Thread vanommen . robert
Hello, I have a Raspberry Pi with 10 temperature sensors. I send the data from the sensors and some other values with json encoding and: result = urllib2.urlopen(request, postData) to a online PHP script wich places the data in a mysql database. In the result: result.read() i am trying to