#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import requests, re
from xml.dom.minidom import parseString
headers = {
'User-Agent': ('Mozilla/5.0 (Windows NT 6.0; rv:14.0) Gecko/20100101 '
'Firefox/14.0.1'),
'Accept':
'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language':
'ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3',
'Accept-Encoding':
'gzip, deflate',
'Connection':
'keep-alive',
'DNT':
'1'
}
page = requests.get(
'http://www.cbr.ru/scripts/XML_daily.asp', headers=headers).text
xmldoc = parseString(page)
usd = xmldoc.getElementsByTagName('Value')[10]
usd = usd.firstChild.nodeValue
print (usd)
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtWidgets import (QWidget, QHBoxLayout, QLabel, QApplication)
from PyQt5.QtGui import QPixmap
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
hbox = QHBoxLayout(self)
pixmap = QPixmap("/home/fil/pictures/Torrents.png")
lbl = QLabel(self)
lbl.setPixmap(pixmap)
hbox.addWidget(lbl)
self.setLayout(hbox)
self.move(100, 200)
self.setWindowTitle('Red Rock')
self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())