Re: dictionary key error, list index out of range

I was going to ask if this dictionary happened to be in a class or not, but I get the feeling it isn't. Check the following:

  1. Make sure that the server dictionary is not declared at class or function scope.

  2. I may be wrong, but ensure that its not declared in a conditional or loop statement either (I believe that loops/conditionals have their own scopes too).

  3. Remember that classes and functions have separate scopes. A variable declared in a function cannot be accessed at the class scope but a variable (field) declared in the class can be accessed within any scopes under it with the use of the self qualifier.

  4. Verify that your variable is declared at the global scope.

  5. Verify that your variable isn't being overwritten by anything your importing using from statements or by anything else your declaring. Remember that Python has no such thing as constants or static variables (which is really, really annoying) and so remember that anything you import can override anything global you've declared.

I hope this helps, but if not can you provide your code?

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Turret via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Dragonlee via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector

Reply via email to