add printtofile.py contents to textgrid.py

as it was in LPL lab module