python json.loads问题

json.loads()传入的是字符串,同时,字符串中的引号必须是双引号,否则会报错。

如:

['S', ['PP', ['ADP', 'In'], ['NP', ['DET', 'the'], ['NP', ['ADJ', '_RARE_'], ['NOUN', '_RARE_']]]], ['S', ['NP', ['ADJ', 'British'], ['NOUN', '_RARE_']], ['S', ['VP', ['VERB', 'were'], ['VP', ['VERB', 'used'], ['S+VP', ['PRT', 'to'], ['VP', ['VERB', '_RARE_'], ['WHNP', ['DET', 'which'], ['NOUN', '_RARE_']]]]]], ['.', '?']]]] #报错
["S", ["PP", ["ADP", "In"], ["NP", ["DET", "the"], ["NP", ["ADJ", "late"], ["NOUN", "1700 
 

你可能感兴趣的:(Python)