jeudi 27 avril 2017

Must str not float python tkinter

  st1= str()    

  c1= str()
  c2= str()
  EndCash = float()

  page = requests.get('http://ift.tt/1Hd4BYE?
       Amount=' + str(st1) + '&From='+(c1) +'&To=' + 
       (c2))
    tree = html.fromstring(page.content)
    rate = tree.xpath('//span[@class="uccResultAmount"]/text()')
    symbol = tree.xpath('//span[@class="uccToCurrencyCode"]/text()')

    EndCash = rate + symbol

Hello I am using the requests module and lxml too harvest Currency rates of the internet.I am encountering problems when doing this. I am getting a Must be Str not float error.Im using this line of code for a lebel in tkinter so the output of this which is EndCash should appear in the label. This code works independly but in tkinter it does not work

      >>>TypeError: must be str, not float




Aucun commentaire:

Enregistrer un commentaire