Qlabel etiketine yazı yazdırma

Combobox ile veriyi cekip,ardından arama butonuna tıklanır tıklanmaz label etiketine yazıyı nasıl yazdırabilirim arkadaşlar?


self.url = 'https://api.openweathermap.org/data/2.5/weather'
self.api_key = '91c0c10cabe49398e6c37c8a9c1ca2ba'
    def guncel_hava_page(self):
        self.ui.stackedWidget.setCurrentIndex(self.hava_page) # hava durumu sayfasına gider
        self.ui.hava_durumu_button.clicked.connect(self.main) # Arama butonu aracılığıyla main fonksiyonuna sinyal gönderdim


    def getWeather(self,deger):
        params = {'q': deger, 'appid': self.api_key, 'lang': 'tr'}
        data = requests.get(self.url, params=params).json()
        if data:
            deger= data['name'].capitalize()
            country = data['sys']['country']
            temp = int(data['main']['temp'] - 273.15)
            coundition = data['weather'][0]['description']
            return (deger, country, temp, coundition)


    def main(self):
        deger=self.ui.comboBox_8.currentText()

        weather=self.getWeather(deger)
        if weather:
            self.ui.location_label.isVisible = '{},{}'.format(weather[0], weather[1])
            #self.ui.temp_label.text = '{} C'.format(weather[2])
            #self.ui.condition_label.text= weather[4]

isVisible kısmını text olarak da yazdım,değişen bir şey olmadı

Buton eylemi için:

button_ismi.clicked.connect(self.sorgu)

Yazdırma için:

label_ismi.setText(değer)

üstad self.sorgu yazmanız teknik açıdan sadece onun sorgu olduğunu görebilmem için değil mi? başka bir esprisi var mı?

Elbette ki.

self.getWeather() ne işe bu da o lakin tek fark var clicked.connect() içerisinde kullanırken parantezleri koymayacaksın.

button_ismi.clicked.connect(self.getWeather()) yapmayacaksın.

buton_ismi.clicked.connect(self.getWeather) yapacaksın.

Teşekkür ederim… Son hali şu şekilde,çokta güzel çalıştı

    def getWeather(self,deger):
        params = {'q': deger, 'appid': self.api_key, 'lang': 'tr'}
        data = requests.get(self.url, params=params).json()
        if data:
            deger= data['name'].capitalize()
            country = data['sys']['country']
            temp = int(data['main']['temp'] - 273.15)
            coundition = data['weather'][0]['description']
            icon = data['weather'][0]['icon']
            return (deger, country,icon,temp, coundition)


    def sorgu(self):
        deger=self.ui.comboBox_8.currentText()

        weather=self.getWeather(deger)
        if weather:
            location_label= '{},{}'.format(weather[0], weather[1])
            self.ui.location_label.setText(location_label)
            temp_label = '{} C '.format(weather[2])  #SORUN BURDA
            self.ui.temp_label.setText(temp_label)
            condition_label= '{}'.format(weather[4])
            self.ui.condition_label.setText(condition_label)

Hocam fakat şu temp_label bölümünde bir sorunla karşılaştım
Normalde label etiketinde 11 C yazması gerekirken 11n C yazıyor bu n nedir nereden geldi anlamadım

birde icon_label eklemek istedim otomatikmen resmi getirebilmek için ne yazmam gerekir sizce?
Emekleriniz için çok teşekkür ederim