diff options
author | ptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b> | 2014-10-11 05:11:47 +0000 |
---|---|---|
committer | ptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b> | 2014-10-11 05:11:47 +0000 |
commit | 455b3d02dec8a349646af26cb11666d88c38e541 (patch) | |
tree | a92d1f91004eecc97cfcf81c1d9f0c9968d3057f /src/examples/parsePythonValue.py | |
parent | 8454ef5f2a7a6b4f1a04953f7bbc90fcb22b4a61 (diff) | |
download | pyparsing-455b3d02dec8a349646af26cb11666d88c38e541.tar.gz |
Minor mods to released examples
git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@277 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
Diffstat (limited to 'src/examples/parsePythonValue.py')
-rw-r--r-- | src/examples/parsePythonValue.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/examples/parsePythonValue.py b/src/examples/parsePythonValue.py index 1a9cd99..53c61fc 100644 --- a/src/examples/parsePythonValue.py +++ b/src/examples/parsePythonValue.py @@ -2,9 +2,10 @@ #
# Copyright, 2006, by Paul McGuire
#
-
+from __future__ import print_function
from pyparsing import *
+
cvtBool = lambda t:t[0]=='True'
cvtInt = lambda toks: int(toks[0])
cvtReal = lambda toks: float(toks[0])
@@ -40,7 +41,7 @@ tupleStr.setParseAction( cvtTuple ) listStr << (lbrack + Optional(delimitedList(listItem) +
Optional(Suppress(","))) + rbrack)
-listStr.setParseAction( cvtList, lambda t: t[0] )
+listStr.setParseAction(cvtList, lambda t: t[0])
dictEntry = Group( listItem + colon + listItem )
dictStr << (lbrace + Optional(delimitedList(dictEntry) + \
|