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

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

Re: Variables in a loop, Newby question

2013-12-27 Thread vanommen . robert
Op dinsdag 24 december 2013 17:23:43 UTC+1 schreef Jean-Michel Pichavant: > - Original Message - > > Hello, for the first time I'm trying te create a little Python > > program. (on a raspberri Pi) > > > > I don't understand the handling of variables in a loop with Python. > > > > > > Let

Re: Variables in a loop, Newby question

2013-12-27 Thread vanommen . robert
Hello everyone, I have been away for a while. I have been reading all the good advises and want to explain why I want to read the temperatures separately from the main script. It takes a long time to read out 10 temperatures. About 10 seconds. So that’s the reason why I had the idea to create a

Re: Variables in a loop, Newby question

2013-12-24 Thread vanommen . robert
Indeed this is code what I found on the web to read temperatures from 10 DS18B20 singlewire sensors. My only programming (little) experience is VBA (Excel mostly). avgtemperatures = [] is indeed from the original code where this line 'avgtemperatures.append(sum(temperatures) / float(len(temper

Re: Variables in a loop, Newby question

2013-12-24 Thread vanommen . robert
import time global Sens_Raw1, Sens_Raw2, Sens_Raw3, Sens_Raw4, Sens_Raw5, Sens_Raw6, Sens_Raw7, Sens_Raw8, Sens_Raw9, Sens_Raw10 while True: sensorids = ["28-054c4932", "28-054c9454", "28-054c9fca", "28-054c4401", "28-054dab99", "28-054cf9b4", "28-054c8a03", "

Variables in a loop, Newby question

2013-12-24 Thread vanommen . robert
Hello, for the first time I'm trying te create a little Python program. (on a raspberri Pi) I don't understand the handling of variables in a loop with Python. Lets say i want something like this. x = 1 while x <> 10 var x = x x = x + 1 The results must be: var1 = 1 var2 = 2