Dictionary with python (character not accepted?)

Hello,
Why there is a display problem when using the : as part of a text string
I don’t see an answer on w3schools

my_dic={"Essai 1":[1,2,3],"Essai 2:":[4,5,6]}
my_dic_with_constructor=dict(Essai_1 = [1,2,3],Essai_2 = [4,5,6])
OUT = my_dic,my_dic_with_constructor,my_dic.keys()

Thank you
Cordially
christian.stan

@christian.stan ,

what do mean exactly?

so that the index is replaced the string ?

my_dic={"Essai 1:":[1,2,3],"Essai 2:":[4,5,6]}

my_dic_with_constructor=dict(Essai_1 = [1,2,3],Essai_2 = [4,5,6])

OUT = my_dic,my_dic_with_constructor,my_dic.keys()

KR
Andreas

Hi, I don’t know, that’s what I’m asking (if you use a : in your key it doesn’t show up but you can use them anyway)
After there is no death of man I can use the _
instead, there may be a restriction unknowingly.

here is the friend

Cordially
christian.stan

your dictionary is correct, It’s a bug of the out DynamoWrapper (Dynamo convert python dictionary to Dynamo Net Dictionary at output Python Node)

you can print yours dictionary to check it

FYI @solamour

2 Likes

thank you for the explanations

cordially
christian.stan

The bug appears to be with dictionaries with a : in them.

Submitted as a bug here: Dictionaries fail when there is a : in the key. · Issue #13777 · DynamoDS/Dynamo (github.com)

3 Likes