import re
from datetime import datetime


def timestampedFilename(baseFileName):
    """Return the .txt filename timestamped as <baseFileName>_<timestamp>.txt.

    The 'baseFileName' is cleansed to have only [-a-zA-Z0-9_] characters.
    """
    return "%s_%s.txt" % (
        re.sub(r'[^-a-zA-Z0-9_\.]+', '', baseFileName),
        datetime.now().strftime('%Y%m%d_%H%M%S'))