On Thursday, 9 March 2017 23:16:15 GMT Ralph Corderoy wrote: > What > https://docs.python.org/2.7/reference/simple_stmts.html#the-global-statement > is saying is that you only need to point out global variables with `global' > when you want to write to them, not just read them. And using `global' is > an indication to the reader that you intend to write, so it isn't used just > to point out a variable is global as that misleads. (The reader can > probably recognise a global that's only being read due to its longer name.)
OK. Thanks. I picked up the idea from a bit of code that I saw, but didn't realise the distinction. > I echo Patrick's question; that seems inconsistent with there only > being one line printed in the other email. > > > > Are the callbacks defined to be edge triggered, so on the switch's > > > transition from off to on? Yes. the ARG is GPIO.RISING. I don't believe that the Library supports level triggering and I wouldn't want that anyway. > You didn't mention whether the Python library says what triggers the > callback. Have you tried moving the switch from off to on and holding > it there against the spring and observe what happens? Does the callback > run once with one line printed? Once it's all finished, let the switch > spring back to off; does it call the callback again? Se my response to Patrick. -- Terry Coles -- Next meeting: Bournemouth, Tuesday, 2017-04-04 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread: mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING Reporting bugs well: http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR