You can use ast.literal_eval()to do it safely.
import ast
data="""\
{
"translate_tabs_to_spaces": True,
"word_wrap": "true",
"font_face": "Monaco",
"font_size": 14.0,
"highlight_line": True,
"ignored_packages":
[
""
],
"what": '''
This is python file, not json
'''
}\
"""
print(ast.literal_eval(data))
Providing us with:
{'what': '\n This is python file, not json\n ', 'font_size': 14.0, 'translate_tabs_to_spaces': True, 'font_face': 'Monaco', 'word_wrap': 'true', 'highlight_line': True, 'ignored_packages': ['']}
Edit
Given the new comment from ICQ, which suggests that he wants to use ...in his configuration, ast.literal_eval()will not match, because he can not handle ellipses. It is not entirely clear if this is what he had in mind, and it is still a good answer to the question that was asked.
, , .