Beispiel #1
0
#Get the path to the main dir
BASE_DIR = os.path.dirname(
    os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

subprocess.call([
    "unoconv", "-f", "csv", "-e", "FilterOptions=44,34,76", "-o",
    "/tmp/listado.csv",
    "%s" % os.path.join(BASE_DIR, 'Listado.ods')
])

ln = LectorNotasCSV('/tmp/listado.csv')
notas_finales_col = ln.nombre_nota_final()

Lista = ['Nº', 'Cuenta', 'Nombre Completo', 'Exa1', 'Exa2', 'Exa3', 'Final']
col_lst = ln.get_col_index(Lista)

with open("/tmp/listado.csv", 'r') as archivo:
    ll = archivo.readlines()


def check_float(s):
    if re.match('^[0-9]+\.+[0-9]+$', s):
        return '{0:3.2f}'.format(float(s))
    else:
        return s


notas = open(os.path.join(BASE_DIR, 'FormatoNotas/notas.cvs'), 'w')
repor = open(os.path.join(BASE_DIR, 'FormatoNotas/reporte.cvs'), 'w')