Re: printing to stdout

2018-08-23 Thread richard lucassen
r explanation, at the prompt I played a bit with the enumerate and zip functions and after all it's quite simple :) > >The code is now as follows: > > Much nicer. A few tiny nit picks: [..] changes applied > >while True: > > if GPIO.input(23) == 1: # if still 0, anothe

Re: printing to stdout

2018-08-19 Thread Richard Lucassen
l, and search for terms like names, or name > binding. And also 'namespace' I'll have to get used to the language and I think it's a nice language. I just mucked about with the sqlite modules BTW. And it works :) -- Richard Lucassen http://contact.xaq.nl/ -- https://mail.python.org/mailman/listinfo/python-list

Re: printing to stdout

2018-08-19 Thread Richard Lucassen
jects are > stored. Names are assigned to reference data objects I'll have another look at it, I was just searching for a clear explanation, but the page I found was not clear enough for me. I'll have to take some time for it... -- Richard Lucassen http://contact.xaq.nl/ -- https://mail.python.org/mailman/listinfo/python-list

Re: printing to stdout

2018-08-19 Thread richard lucassen
oop, disabling 10 seconds') sys.stdout.flush() sleep (10) sys.stdout.flush() GPIO.cleanup() And it still works :-) Thnx! R. -- richard lucassen http://contact.xaq.nl/ -- https://mail.python.org/mailman/listinfo/python-list

Re: printing to stdout

2018-08-19 Thread richard lucassen
On Sun, 19 Aug 2018 12:02:51 +0300 Marko Rauhamaa wrote: > richard lucassen : > > As I'm new to Python, just this question: are there any unPythony > > things in this code? > > Your code looks neat. Well, apparently there were quite a lot of things that makes the

Re: printing to stdout

2018-08-19 Thread richard lucassen
3) == 1: loopcntr = 0 break loopcntr += 1 if loopcntr >=20: print ('[ALERT] possible INT loop, disabling 10 seconds') sys.stdout.flush() sleep (10) sys.stdout.flush() GPIO.cleanup() And it still works :-) Thnx! R. -- richard lucassen http://contact.xaq.nl/ -- https://mail.python.org/mailman/listinfo/python-list

Re: printing to stdout

2018-08-19 Thread richard lucassen
("[ALERT] I/O problem device 0x%x" % list_pcf[i]) if GPIO.input(23) == 1: loopcntr = 0 break else: loopcntr += 1 if loopcntr >=20: print ('[ALERT] possible INT loop, disable 10 seconds') sleep (10) sys.stdout.flush() GPIO.cleanup() -- richard lucassen http://contact.xaq.nl/ -- https://mail.python.org/mailman/listinfo/python-list

Re: printing to stdout

2018-08-17 Thread richard lucassen
nd maintainable. Yep, the "sys.stdout.flush()" did the job :) I had already been mucking about with file=sys.stderr, but without result, just because of the fact that stderr is never buffered AFAIK (the supervised script "run" has an "exec 2>&1") Anyroad, it works :) Thnx! -- richard lucassen http://contact.xaq.nl/ -- https://mail.python.org/mailman/listinfo/python-list

printing to stdout

2018-08-16 Thread richard lucassen
#x27;) sleep (10) GPIO.cleanup() Anyone a hint? Note: I'm a newbie to python. -- richard lucassen http://contact.xaq.nl/ -- https://mail.python.org/mailman/listinfo/python-list