Skip to content

Instantly share code, notes, and snippets.

@rodgomesc
Created July 13, 2015 21:40
Show Gist options
  • Save rodgomesc/2c6d85f85ac0cc28a3d5 to your computer and use it in GitHub Desktop.
Save rodgomesc/2c6d85f85ac0cc28a3d5 to your computer and use it in GitHub Desktop.
Youtube_embed_PyQt.py
from PyQt4.QtGui import QApplication
from PyQt4.QtCore import QUrl
from PyQt4.QtWebKit import QWebView
from PyQt4.QtCore import QString
import sys
__autor__= 'Rodrigo Gomes'
app = QApplication(sys.argv)
b = QWebView()
string = QString("""<!DOCTYPE html>
<html>
<body>
<iframe width="560" height="315" src="//www.youtube.com/embed/PLe1Buo9ERpeVkq-3aqxBSeriyV-didkwW" frameborder="0" allowfullscreen></iframe>
</body>
</html>""")
b.setHtml(string,QUrl('https://youtube.com'))
b.show()
app.exec_()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment