[Tutor] UPDATE: Is there a 'hook' to capture all exits from a python program?

2015-03-20 Thread Doug Basberg
I do real-time controls programming and I control a relay in a python program that must be turned off before the program ends. First, the program should never exit unless I do it explicitly. Is there a 'hook' to process before any exit (even if not expected). I must turn off that relay or harm m

[Tutor] Is there a 'hook' to capture all exits from a python program?

2015-03-18 Thread Doug Basberg
I do real-time controls programming and I control a relay in a python program that must be turned off before the program ends. First, the program should never exit unless I do it explicitly. Is there a 'hook' to process before any exit (even if not expected). I must turn off that relay or harm m

[Tutor] using json to pass a dict thru a file

2015-03-17 Thread Doug Basberg
I appreciate the advise to use json to pass a dict thru a file. Below is the code To 'dump' the dict to a file and the code to 'load' the dict and the error message I get testing this. What am I doing wrong? Thanks. /

[Tutor] passing dictionaries through a file

2015-03-16 Thread Doug Basberg
I would like to pass the contents of a dictionary from one program to another through a file. So, what is the elegant way to pass a dictionary by file? My early learning about Python seems to indicate that only ascii is easily passed in files. I am using Python 2.7.4 now. Should I be learning o

[Tutor] print method in Python2.7 problem

2015-03-15 Thread Doug Basberg
Stat = {'Vbatt': 51.24, 'Ichrg': 6.75} print ' SOLAR PANEL VOLTAGE' print('DSB "HI;" %s') % (str(Stat['Vbatt'])) print(' %s') % (str(Stat['Vbatt'])) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://m