Answer the question
In order to leave comments, you need to log in
How to output data to pyqt5?
New to python! I put together a simple project and I want to display data in a window!
import sys, requests
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QIcon
url = 'http://api.cryptonator.com/api/ticker/btc-rub'
response = requests.get(url)
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.setGeometry(300, 300, 300, 220)
self.show(response.json())
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
Answer the question
In order to leave comments, you need to log in
Strangely, the documentation says the same thing : the show method should be called with no arguments.
Of course, you should not pay attention to this: I want to display data in a window and I will!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question