#!/usr/bin/python # -*- coding: utf-8 -*- # # Pyromaths # Un programme en Python qui permet de créer des fiches d'exercices types de # mathématiques niveau collège ainsi que leur corrigé en LaTeX. # Copyright (C) 2006 -- Jérôme Ortais (jerome.ortais@pyromaths.org) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # import priorites import symetrie import fractions from outils import tex_entete from pyro_classes import WriteFiles import os.path import gettext import locale locale.setlocale(locale.LC_ALL, "") locale.textdomain("pyromaths") gettext.textdomain("pyromaths") _=locale.gettext def main(lst, fiche_exos, fiche_corrige, entete): modules = (priorites.main, symetrie.main, fractions.fractions_egales, fractions.sommes_fractions, fractions.produits_fractions) fiche_metapost = os.path.splitext(fiche_exos)[0] + '.mp' files = WriteFiles(fiche_exos, fiche_corrige, fiche_metapost, entete) files.f0.write(_('\\chead{\\Large{\\textsc{Fiche de r\\\'evisions}}}\n')) files.f1.write(_("\\chead{\\Large{\\textsc{Corrige de la fiche de r\\'evisions}}}\n")) files.f0.write(_('\\rhead{\\textsl{\\footnotesize{Classe de 5\\ieme}}}\n')) files.f1.write(_('\\rhead{\\textsl{\\footnotesize{Classe de 5\\ieme}}}\n')) for j in xrange(len(modules)): for i in xrange(lst[j]): WriteFiles.write(files, modules[j]()) WriteFiles.close(files)