[Ironpython-users] Scripting Ansys with IronPython - Unable to call values from dictionary

Jeff Hardy jdhardy at gmail.com
Fri Nov 25 09:30:58 CET 2011


On Thu, Nov 24, 2011 at 11:12 PM, Ossi Heinonen <ossi.heinonen at tut.fi> wrote:
> Hi again
>
> Could it be possible to use some sort of wildcard method in this one? Like
>
>    verifiedValues['*P1*']
>
> or
>
>    verifiedValues['?P1?']
>
> Just a thought that seems intuitive, but is it doable?

No, that won't work with a plain Python dict (it could be made to work
on a custom object, but that doesn't appear to be what you have here).

Actually, you probably have a .NET dictionary (which is shown as dict,
confusingly) - the question is whether it's generic or not. Can you
try calling verifiedValues.GetType()?

Also, is there a reason you're using 2.6? I believe 2.7 has some fixes
around generics, so that may be necessary.

- Jeff


More information about the Ironpython-users mailing list