Getting JSON output from within Python #20
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi! Is there a native way to get a JSON output from within Python directly?
For now, I go with
Hello there, sorry for the delay!
The JSON output was a bit of a hack, using the
Device._asdict()
method added bynamedtuple
and justvars
for theNameWithID
orSlot
classes. You can see how it did its output right here.I'm working on adding a bunch of
as_dict()
methods, so that you could go with something like this:This would give you a list of dicts with the same structure as what
python3 -m pylspci
can output. I'm putting the finishing touches and releasing 0.4.0 in a few hours!mentioned in merge request !16
mentioned in commit
7cebd6202d