def saveLocationHistory(history, filename):
    """Saves the given location ``history`` to the given ``filename``. See
    :func:`loadLocationHistory` and :meth:`LocationHistoryPanel.getHistory`.
    """
    lines = []
    for loc, comment in history:
        loc = '{:0.8f} {:0.8f} {:0.8f}'.format(*loc)
        lines.append('{} {}'.format(loc, comment))
    with open(filename, 'wt') as f:
        f.write('\n'.join(lines))
