S-expressions

The ppci.lang.sexpr module can be used to read S-expressions.

>>> from ppci.lang.sexpr import parse_sexpr
>>> parse_sexpr('(bla 29 ("hello world" 1337 @#!))')
('bla', 29, ('hello world', 1337, '@#!'))

Reference

Functionality to tokenize and parse S-expressions.

ppci.lang.sexpr.parse_sexpr(text: str, multiple=False) → tuple

Parse S-expression given as string. Returns a tuple that represents the S-expression.