def stringint(k, n):
    """ returns string of k by placing zeros before to have n characters
    ex: 1 -> '0001'
    15 -> '0015'

    # ugly way: better use  '%04d'%k  for n=4 for isntance
    """
    strint = str(k)
    res = '0' * (n - len(strint)) + strint
    return res
