Python - Using Qt5 to build a simple web browser
<p>I was trying to build this example: </p>

<p><a href="https://www.linuxvoice.com/build-a-web-browser-with-20-lines-of-python/" rel="nofollow noreferrer">https://www.linuxvoice.com/build-a-web-browser-with-20-lines-of-python/</a></p>

<p>I'll just repost it here for completeness:</p>

<pre><code>from PyQt5.QtCore import QUrl 
from PyQt5.QtWidgets import QApplication 
from PyQt5.QtWebKitWidgets import QWebView 
import sys

app = QApplication(sys.argv) 
view = QWebView() 
view.show() 
view.setUrl(QUrl(“http://linuxvoice.com”)) 
app.exec()
</code></pre>

<p>I also used the indications here to install pyqt5</p>

<p><a href="https://askubuntu.com/questions/612314/how-to-install-pyqt-for-python3-in-ubunt-14-10">https://askubuntu.com/questions/612314/how-to-install-pyqt-for-python3-in-ubunt-14-10</a></p>

<p>and also installed Qt5. So I should have everything they say in the linuxvoice tutorial. </p>

<p>When I want to run this with python 2.7, it says:</p>

<pre><code> File "brows.py", line 9 SyntaxError: Non-ASCII character '\xe2' in file brows.py on line 9, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
</code></pre>

<p>and with Python3:</p>

<pre><code>File "brows.py", line 9
view.setUrl(QUrl(“http://linuxvoice.com”)) 
SyntaxError: invalid character in identifier
</code></pre>

<p>Did anyone manage to make this work? </p>