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
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
On Thu, Dec 26, 2013 at 7:14 PM, Dave Angel wrote:
> On Thu, 26 Dec 2013 16:41:57 +1100, Steven D'Aprano
> wrote:
>>
>> Chris Angelico wrote:
>> > Does anyone else have the vague feeling that the OP's problem
> might be
>> > better served by simply importing the script (thus making those
> values
On Thu, 26 Dec 2013 16:41:57 +1100, Steven D'Aprano
wrote:
Chris Angelico wrote:
> Does anyone else have the vague feeling that the OP's problem
might be
> better served by simply importing the script (thus making those
values
> available to another Python script) than by any of these rat
On 12/24/2013 11:27 AM, vanommen.rob...@gmail.com wrote:
> 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).
>
Definitely you'll want to learn python before you go much farther
Chris Angelico wrote:
> Does anyone else have the vague feeling that the OP's problem might be
> better served by simply importing the script (thus making those values
> available to another Python script) than by any of these rather more
> complicated theories?
Damn yes!
--
Steven
--
https
On Thu, Dec 26, 2013 at 12:01 PM, Cameron Simpson wrote:
> On 25Dec2013 15:27, Denis McMahon wrote:
>> On Wed, 25 Dec 2013 16:42:47 +1100, Cameron Simpson wrote:
>> > On 25Dec2013 02:54, Denis McMahon wrote:
>> >> On Tue, 24 Dec 2013 10:27:13 -0800, vanommen.robert wrote:
>> >> > In this script
On 25Dec2013 15:27, Denis McMahon wrote:
> On Wed, 25 Dec 2013 16:42:47 +1100, Cameron Simpson wrote:
> > On 25Dec2013 02:54, Denis McMahon wrote:
> >> On Tue, 24 Dec 2013 10:27:13 -0800, vanommen.robert wrote:
> >> > In this script i want to read the temperatures and make them
> >> > available t
On Wed, 25 Dec 2013 16:42:47 +1100, Cameron Simpson wrote:
> On 25Dec2013 02:54, Denis McMahon wrote:
>> On Tue, 24 Dec 2013 10:27:13 -0800, vanommen.robert wrote:
>> > In this script i want to read the temperatures and make them
>> > available to other scripts. [...]
>> If you want this process
vanommen.rob...@gmail.com wrote:
> 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
>
> 'avgtemperat
On 12/24/2013 08:07 AM, vanommen.rob...@gmail.com wrote:
[snip...]
x = 1
while x <> 10
var x = x
x = x + 1
[snip...]
Besides the other valid answers you have received, I want to add one other minor nit. The
symbol <> for unequal is deprecated -- it's better to use != instead.
On 25Dec2013 02:54, Denis McMahon wrote:
> On Tue, 24 Dec 2013 10:27:13 -0800, vanommen.robert wrote:
> > In this script i want to read the temperatures and make them available
> > to other scripts. [...]
> If you want this process to provide data to other processes, you might
> want to look at u
On Tue, 24 Dec 2013 10:27:13 -0800, vanommen.robert wrote:
> In this script i want to read the temperatures and make them available
> to other scripts.
The "global" keyword doesn't do that.
"global" is used inside a function definition in python to tell the
function that it is working with a gl
On Tue, 24 Dec 2013 09:54:48 -0800 (PST), vanommen.rob...@gmail.com
wrote:
You should always start by mentioning python version and o.s.
import time
global Sens_Raw1, Sens_Raw2, Sens_Raw3, Sens_Raw4, Sens_Raw5,
Sens_Raw6, Sens_Raw7, Sens_Raw8, Sens_Raw9, Sens_Raw10
The global statement make
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
On Tue, Dec 24, 2013 at 12:54 PM, wrote:
> 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-00
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",
"
On 12/24/2013 11:07 AM, vanommen.rob...@gmail.com wrote:
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
vanommen.rob...@gmail.com wrote:
> 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
On 24.12.2013 17:07, vanommen.rob...@gmail.com wrote:
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
- 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.
>
>
> Lets say i want something like this.
>
> x = 1
> while x <> 10
> var x = x
> x =
On Tue, Dec 24, 2013 at 11:07 AM, wrote:
> 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
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
23 matches
Mail list logo