开发者

Display formatted text in a window using python

I make a program in wxpython which displays questions to the user and a radiobox with answers. Questions and answers should be in a database and is formatted text using开发者_JS百科 some mathematics (paranthesis, root squares etc). Could you propose me what widget I should use for such a text and what could be the database? Thanks.


For database you can use any sql based DB e.g. mysql or sqllite but if you do not have much data why not just store it in text files or as python module itself.

Displaying math symbols part is tricky, you will need a control which can display MathML(http://en.wikipedia.org/wiki/MathML) , I don't think any wxPython widget can do that, some browsers display MathML, so you may embed browser inside wxpython but that is also tricky.

Another alternative is to use mathplotlib to draw math symbols e.g. see http://matplotlib.sourceforge.net/users/mathtext.html#mathtext-tutorial

but IMO simplest/best way would be to just convert mathml xml to a image file and display it in a image control inside your app. e.g. you can use http://sourceforge.net/projects/svgmath/ to convert mathml to svg, convert svg to png using http://librsvg.sourceforge.net/

or you can also try http://sourceforge.net/projects/jeuclid/

You will have to experiment to see what is easiest for you but i don't think there is any easy way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜