문제

How do I get an NSDictionary from a Python dictionary (so that I can call description on it) ?

도움이 되었습니까?

해결책

>>> d = NSDictionary.dictionaryWithDictionary_({"foo": "bar"})
>>> type(d)
<objective-c class __NSDictionaryI at 0x7fff7ae34688>
>>> d.description()
u'{\n    foo = bar;\n}'
>>> d
{
    foo = bar;
}
>>> 
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top