问题描述:

How to convert HTML CSS file to wxPython files? That is, how to create slidsheet in wxPython like HTML CSS files?

网友答案:

It is not at all clear what you want to achieve, I guess you want to display some HTML files in wxPython. In that case there isn't any generic HTML renderer which will render all HTML/CSS files, but simple HTML files can be rendered using the HTML control.

See http://www.wxpython.org/docs/api/wx.html.HtmlWindow-class.html

If you need to display any generic HTML page then best way is to use the WebKit port for wx (http://wxwebkit.wxcommunity.com/index.php?n=Main.BuildInstructions) or

the webkit control (http://www.wxpython.org/docs/api/wx.webkit.WebKitCtrl-class.html) which comes with wxPython, but it will not run on all platforms.

网友答案:

If you want to view simple HTML files in wxPython, then check out wx.HtmlWindow. If CSS is required, you'll probably need to use ActiveX Internet Explorer widget on Windows (see wx.lib.iewin or the wxPython demo). Alternately, you could use the wxWebkit project, which is strictly beta: http://wxwebkit.kosoftworks.com/ or http://wxwebkit.kosoftworks.com/index.php?n=Main.Downloads

If you're talking about using HTML to create Python code, that doesn't work to my knowledge. However you can do something similar with XML via XRC and XRCed.

网友答案:

stylesheet, not slidesheet.

f = open('NAMEOFSTYLESHEET.css','w')

f.write('#ID{}\n.class{}')

相关阅读:
Top