Problem:
When needing to have JSON tools in IronPython, you are normally guided to use the System Web Extensions:-
clr.AddReference('System.Web.Extensions')
This will not work under Linux, because this is a Microsoft library.
Under linux you get the error:-
Could not execute script 'Copy to Clipboard': Could not add reference to assembly System.Web.Extensions
Solution:
Use the inbuilt IronPython json tools:-
import json
Document.Properties["output1"] = json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
Document.Properties["output2"] = json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True)
In fact this should be the default solution, as it will work for both Windows and Linux.
This box will be hidden from the public.
Source Case #274555
Comments
0 comments
Article is closed for comments.