Related
https://groups.google.com/forum/#!searchin/python_inside_maya/pickle%7Csort:date/python_inside_maya/izd5hROg-LI/vc-GrWadAQAJ

On 28 April 2018 at 18:38, Justin Israel <[email protected]> wrote:

> Hi,
>
> Avoid using the string representation of a dict and eval(). Instead,
> encode it to either json or python specific cPickle
>
> https://docs.python.org/2/library/json.html
>
> https://docs.python.org/2/library/pickle.html
>
> For pickle, you can use the protocol 0 which is the ascii format.
>
> Justin
>
>
> On Sat, Apr 28, 2018, 9:34 PM miarmy <[email protected]> wrote:
>
>> Hi....i have a python dict...
>> I want write it on the attribue of my node or read...
>> Now, which attr type to choose for my node?
>> I test this type:
>> #attr type:
>> Om.MFnTypedAttribute().create('test','t', Om.MFnData.kString)
>> ...
>> For write or save dict on the node...i convert the dict to string and
>> save it.and when iitant to read.... I use eval() function:
>> dict = eval(string)
>> But eval function is very very slow....in the big dict or string...
>> One point... My dict have only float number.. this form:.{1:[2,4.5],
>> 4:[6,9.2], ... }
>> Excuse me.my english is bad
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/python_inside_maya/b010424c-6238-487a-9e7e-
>> f9d6fabd22c8%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/CAPGFgA31J9%3DPj0zFD%3D90SQSz3bJoPO489zfRcPPKBA-
> 6acDrRQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA31J9%3DPj0zFD%3D90SQSz3bJoPO489zfRcPPKBA-6acDrRQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCSbuSpdo-bLm8LvM%2BdiKi9WZa586pxS05u-xF-P3BQrg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to