Exemplo n.º 1
0
 def news_update(self):
     news_crawling.news_update()
     self.news1.setText(news_crawling.news_value[0])
     self.news2.setText(news_crawling.news_value[1])
     self.news3.setText(news_crawling.news_value[2])
     self.news4.setText(news_crawling.news_value[3])
     self.news5.setText(news_crawling.news_value[4])
Exemplo n.º 2
0
    def TestStack1(self):
        #현재시간 라벨
        self.TC = QDateTime.currentDateTime()
        self.TimeClock = QLabel(self.TC.toString("yyyy-MM-dd hh:mm:ss"))
        self.TimeClock.setFont(QFont('휴먼모음T', 30))
        self.TimeClock.setStyleSheet("color: white;")
        self.TimeClock.setAlignment(Qt.AlignCenter)

        #날씨 라벨
        weather_crawling.weather_read('성남시')

        self.weather = QLabel(weather_crawling.location + " " +
                              weather_crawling.temp + "˚ " +
                              weather_crawling.climate[0])
        self.weather.setFont(QFont('휴먼모음T', 20))
        self.weather.setStyleSheet("color: white;")

        img_weather = QPixmap('image_sample/' + weather_crawling.climate[0] +
                              '.png')
        self.weather_img = QLabel()
        self.weather_img.setPixmap(img_weather)

        #뉴스 라벨
        news_crawling.news_update()

        self.news1 = QLabel(news_crawling.news_value)
        self.news1.setFont(QFont('휴먼모음T', 15))
        self.news1.setStyleSheet("color: white;")

        #레이아웃
        weather_layout = QVBoxLayout()
        weather_layout.addWidget(self.weather)
        weather_layout.addWidget(self.weather_img)

        news_layout = QVBoxLayout()
        news_layout.addWidget(self.news1)

        weather_news = QHBoxLayout()
        weather_news.addStretch(1)
        weather_news.addLayout(news_layout)
        weather_news.addStretch(10)
        weather_news.addLayout(weather_layout)
        weather_news.addStretch(1)

        stack1_layout = QVBoxLayout()
        stack1_layout.addStretch(1)
        stack1_layout.addWidget(self.TimeClock)
        stack1_layout.addStretch(1)
        stack1_layout.addLayout(weather_news)
        stack1_layout.addStretch(10)

        self.stack1.setLayout(stack1_layout)
        self.swUI.addWidget(self.stack1)
Exemplo n.º 3
0
 def news_update(self):
     news_crawling.news_update()
     self.news1.setText(news_crawling.news_value)
Exemplo n.º 4
0
 def news_update(self):
     news_crawling.news_update()
     print(news_crawling.news_value[0])