Skip to content

Instantly share code, notes, and snippets.

@jerome-diver
Last active April 21, 2020 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jerome-diver/611b48ad5f05336605a0b3d8e51179ec to your computer and use it in GitHub Desktop.
Save jerome-diver/611b48ad5f05336605a0b3d8e51179ec to your computer and use it in GitHub Desktop.
trying to get json object from command returning json through subprocess call
import json
import subprocess
# you need to have taskwarrior application installed on the Linux system to rich the shell command to return a json data
j = json.loads(subprocess.run(["task", "status:pending", "export"], capture_output=True, check=True).stdout)
@jerome-diver
Copy link
Author

thank you @graingert from freenode IRC server channel #python to help me to find the solution...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment