Parser needed.

Skybuck Flying skybuck2000 at hotmail.com
Thu Jun 4 13:23:17 EDT 2015


Very nice code almost done.

Now I am trying to do the code correctly and fast, thus using a dictionary, 
but I run into a little problem:

The dictionary is declared as:

DemoEntityRefIndex = {}

Pairs are added as:

DemoEntityRefIndex[Ref] = DemoEntityIndex

And now I try to retrieve the demo entit index as follows:

DemoEntityIndex = DemoEntityRefIndex[Ref]

But somehow it fails with error:

[error] script [ ParseDemoFile ] stopped with error in line 211
[error] KeyError ( EntityRef )
[error] --- Traceback --- error source first line: module ( function ) 
statement 146: main ( ProcessUpdateEntityRef ) DemoEntityIndex = 
DemoEntityRefIndex[Ref]

Hmm..

I may try dict.get maybe that ll help.

Bye,
  Skybuck.













More information about the Python-list mailing list