diff options
author | Hugo <hugovk@users.noreply.github.com> | 2018-08-09 16:55:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-09 16:55:29 +0300 |
commit | af1fd83ca86312d456da846e379f913f07f794e9 (patch) | |
tree | 430138b65103d23b580667e6542356d1170698f3 | |
parent | 8da759898768311ad3a67a1963d6132f138469a1 (diff) | |
download | pyparsing-git-af1fd83ca86312d456da846e379f913f07f794e9.tar.gz |
Use Python code formatting
-rw-r--r-- | README.md | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -12,10 +12,12 @@ that client code uses to construct the grammar directly in Python code. Here is a program to parse "Hello, World!" (or any greeting of the form
"salutation, addressee!"):
- from pyparsing import Word, alphas
- greet = Word( alphas ) + "," + Word( alphas ) + "!"
- hello = "Hello, World!"
- print hello, "->", greet.parseString( hello )
+```python
+from pyparsing import Word, alphas
+greet = Word( alphas ) + "," + Word( alphas ) + "!"
+hello = "Hello, World!"
+print hello, "->", greet.parseString( hello )
+```
The program outputs the following:
|