mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-08-10 22:41:51 +02:00
fix streaming python module example
This commit is contained in:
@@ -277,12 +277,11 @@ Streaming parsers accept any iterable object and return a generator iterator obj
|
|||||||
To use the generator object in your code, simply loop through it:
|
To use the generator object in your code, simply loop through it:
|
||||||
|
|
||||||
```
|
```
|
||||||
import json
|
|
||||||
import jc.parsers.ls_s
|
import jc.parsers.ls_s
|
||||||
|
|
||||||
result = jc.parsers.ls_s.parse(ls_command_output.splitlines())
|
result = jc.parsers.ls_s.parse(ls_command_output.splitlines())
|
||||||
for item in result:
|
for item in result:
|
||||||
item_dict = json.loads(item)
|
print(item["filename"])
|
||||||
```
|
```
|
||||||
|
|
||||||
### Custom Parsers
|
### Custom Parsers
|
||||||
|
@@ -200,12 +200,11 @@ Streaming parsers accept any iterable object and return a generator iterator obj
|
|||||||
To use the generator object in your code, simply loop through it:
|
To use the generator object in your code, simply loop through it:
|
||||||
|
|
||||||
```
|
```
|
||||||
import json
|
|
||||||
import jc.parsers.ls_s
|
import jc.parsers.ls_s
|
||||||
|
|
||||||
result = jc.parsers.ls_s.parse(ls_command_output.splitlines())
|
result = jc.parsers.ls_s.parse(ls_command_output.splitlines())
|
||||||
for item in result:
|
for item in result:
|
||||||
item_dict = json.loads(item)
|
print(item["filename"])
|
||||||
```
|
```
|
||||||
|
|
||||||
### Custom Parsers
|
### Custom Parsers
|
||||||
|
Reference in New Issue
Block a user