Jump to content

Recommended Posts

  • Forum Moderator
  • exception KeyError

Raised when a mapping (dictionary) key is not found in the set of existing keys.

For example:

mydict = {
  'EmpireName': ui.TextLine, 
  'GuildImage': ui.ExpandedImageBox
}

>>> empireName = mydict['EmpireName']
# <ui.TextLine object at 0x06FC3310>

>>> guildImage = mydict['SkillName']
# Traceback (most recent call last):
#   File "<stdin>", line 1, in <module>
# KeyError: 'SkillName'

Check your selectcharacterwindow.py and be sure you have the object called 'EmpireName'.

  • Love 1
Link to comment
Share on other sites

vor 31 Minuten schrieb VegaS™:
  • exception KeyError

Raised when a mapping (dictionary) key is not found in the set of existing keys.

For example:


mydict = {
  'EmpireName': ui.TextLine, 
  'GuildImage': ui.ExpandedImageBox
}

>>> empireName = mydict['EmpireName']
# <ui.TextLine object at 0x06FC3310>

>>> guildImage = mydict['SkillName']
# Traceback (most recent call last):
#   File "<stdin>", line 1, in <module>
# KeyError: 'SkillName'

Check your selectcharacterwindow.py and be sure you have the object called 'EmpireName'.

 

Thank you for your answer Vegas!

 

but im using the same files on a other Client and no keyError is appearing there, but on my new clean Client i receive keyerror. (And EmpireName is existing i Can post my Python file if you want)

Link to comment
Share on other sites

  • Forum Moderator
5 minutes ago, Syriza said:

edit: solved, empireName wasn't the problem a class was missing in ui.py

@VegaS™

Of course, the output of syserr or in generally the lines which showing the errors are not printed 100% the line fixed with the problem, there could be a syntax error, missing things etc. Before/after your EmpireName object too, and blocked while reading the code and your dictionary have missed some objects.

We can't fix a error all time just because of one line in syserr, you need to investigate the files related and see what's the real problem and use debug method. 

  • Love 1
Link to comment
Share on other sites

vor 1 Minute schrieb VegaS™:

Of course, the output of syserr or in generally the lines which showing the errors are not printed 100% the line fixed with the problem, there could be a syntax error, missing things etc. Before/after your EmpireName object too, and blocked while reading the code and your dictionary have missed some objects.

We can't fix a error all time just because of one line in syserr, you need to investigate the files related and see what's the real problem and use debug method. 

 

thank you for help buddy i just wanted to say so other people know too

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.