API tkinter python entry
Question: I have a problem with the entry. I want the user to write in any city they
want in the  
API link. I get that i cant convert to a str. So when ever the user choose to
enter a city he can just click on the button forecast after he entered the
city in the Entry and the weather will be printed:

    
    
    from tkinter import *
    import requests
    import json
    
    class Application(Frame):
    
        def __init__(self, master=None):
            Frame.__init__(self, master)
            self.root = master
            self.pack()
            self.create_widgets()
    
        def create_widgets(self):
            self.v = StringVar()
            self.e = Entry(self, textvariable=self.v)
            self.e.pack(side="left")
    
            self.v.set("Enter City")
            self.s = self.v.get()
            self.e.focus_set()
    
    
            self.butn = Button(self)
            self.butn["text"] = "Forecast"
            self.butn["command"] = self.make_request
            self.butn.pack(side="left")
    
            self.QUIT = Button(self, text="QUIT", command=self.root.destroy)
            self.QUIT.pack(side="right")
    
    
        def make_request(self):
            r = requests.get("http://api.wunderground.com/api/ab78bcbaca641959/forecast/q/Sweden/" + ???? + ".json")
            data = r.json()
            for day in data['forecast']['simpleforecast']['forecastday']:
                print (day['date']['weekday'] + ":")
                print ("Conditions: ", day['conditions'])
                print ("High: ", day['high']['celsius'] + "C", "Low: ", day['low']['celsius'] + "C", '\n')
            return data
    
    
    
    
    
    
    rot = Tk()
    rot.geometry("900x650+200+50")
    rot.title("The Trip")
    
    app = Application(master=rot)
    app.mainloop()
    


Answer: Use `self.v.get()` in place of `????` and it works

    
    
    r = requests.get("http://api.wunderground.com/api/ab78bcbaca641959/forecast/q/Sweden/" + self.v.get() + ".json")
    

By the way: you don't need `self.s = self.v.get()` anymore.

