Last active
January 9, 2019 09:12
-
-
Save antonu17/d52d51032cf5f7bc499be309ad4c5ecc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| def dict_update(dict, path, value): | |
| """ | |
| data = { | |
| 'browsers': [ | |
| { | |
| 'name': 'chrome', | |
| 'version': 70 | |
| }, | |
| { | |
| 'name': 'firefox', | |
| 'version': 60 | |
| } | |
| ] | |
| } | |
| >>> dict_update(data, '.browsers | select(.name=="firefox").value', 61) | |
| data = { | |
| 'browsers': [ | |
| { | |
| 'name': 'chrome', | |
| 'version': 70 | |
| }, | |
| { | |
| 'name': 'firefox', | |
| 'version': 61 | |
| } | |
| ] | |
| } | |
| """ | |
| pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment