LocadQuery2.py, write balance to file