简体   繁体   English

如何使用Python制作一个简单的跨平台webbrowser?

[英]How to make a simple cross-platform webbrowser with Python?

The http://code.google.com/p/pywebkitgtk/ looks great but it seems to be running on linux only. http://code.google.com/p/pywebkitgtk/看起来不错,但它似乎只在linux上运行。

Does anybody know if there is something similar but cross-platform? 有没有人知道是否有类似但跨平台的东西?

If not what can be the alternatives to make with Python a simple web-browser that can run on Windows, MAC os and linux? 如果没有,可以用Python制作一个简单的Web浏览器,可以在Windows,MAC OS和Linux上运行吗?

Thanks in advance 提前致谢

Update: Does anybody has some information about wxWebKit ? 更新:有没有人有关于wxWebKit的一些信息?

Qt (which has Python bindings with PyQt or PySide ) offers Webkit (the same engine as Safari). Qt(与PyQtPySide有Python绑定)提供Webkit (与Safari相同的引擎)。 Making a simple cross-platform browser is trivially implemented with this. 用这个简单地实现了一个简单的跨平台浏览器。

To show how easy this really is (example taken from the link): 为了表明这是多么容易(例如从链接中获取):

#!/usr/bin/env python

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *

app = QApplication(sys.argv)

web = QWebView()
web.load(QUrl("http://www.stackoverflow.com"))
web.show()

sys.exit(app.exec_())

Coming back to this question asked 3 years ago, I would like to mention Chromium Embdedded Framework . 回到3年前提出的这个问题,我想提一下Chromium Embdedded Framework It worths a try. 值得一试。

如果您不介意在开源项目中修改代码,可以尝试在现代版本的Python中运行Grail

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM