update TP.py and add Ch.5 programs