Jump to content
  • 0

Question about python


Necro

Question

6 answers to this question

Recommended Posts

  • 0
  • Premium

I have it like this: 

 

test replace with PetProcentExp

def _GameWindow__PetExp(self, PetProcentExp):
self.PetExpLabel.SetText(float(PetProcentExp[:PetProcentExp.find('.')+3]) + "%")
self.PetExpBar.SetPercentage(PetProcentExp, 100)

syserr:

unsupported operand types for +: 'float' and 'str'
Link to comment
Share on other sites

  • 0
  • Premium

 

You trying to append a string to an int which is not allowed.

str(float(PetProcentExp[:PetProcentExp.find('.')+3])) + "%"

 

Thank but still was a problem.

 

self.PetExpLabel.SetText("%.2f" % float(3.78889564646))

 

Thank you very much..now its work.

 

Solved

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Activity

    1. 10

      When Uninstalling Gaya System

    2. 10

      When Uninstalling Gaya System

    3. 10

      When Uninstalling Gaya System

    4. 10

      When Uninstalling Gaya System

    5. 10

      When Uninstalling Gaya System

    6. 10

      When Uninstalling Gaya System

    7. 10

      When Uninstalling Gaya System

    8. 8

      Use Items with the Effect of Use

    9. 10

      When Uninstalling Gaya System

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.