def fix_varname(s):
        t = s.translate(s.maketrans(BAD_FILECHARS, GOOD_FILECHARS))
        while t.endswith('_'): t = t[:-1]
        return t
fix string to be a 'good' variable name.
dataset/ETHPy150Open xraypy/xraylarch/plugins/io/fileutils.py/fix_varname