Jump to content

Recommended Posts

  • 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
https://metin2.dev/topic/4465-question-about-python/#findComment-28287
Share on other sites

  • 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
https://metin2.dev/topic/4465-question-about-python/#findComment-28294
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.