Le 4 févr. 07 à 17:45, Alain Matthes a écrit :
I 'm not an expert with python : it's my first code !
ans i make a mistake with cut and paste
import codecs from pygments import highlight from pygments.lexers import TexLexer from pygments.formatters import HtmlFormatter fileObj = codecs.open("/Users/ego/Desktop/sign-diagram.tex", "r" , "utf8") code = fileObj.read() filecontent = highlight(u, TexLexer(), HtmlFormatter()) unicodefilecontent = unicode(filecontent) out = file( "/Users/ego/Desktop/sign-diagram.html", "w") out.write(unicodefilecontent) out.close()
it's better like this
Alain
ps perhaps an expert with python can help me with : import os, sys etc... to make this script more easy to use !