Update textgrid.py

re-work printtoFile function