-
-
Notifications
You must be signed in to change notification settings - Fork 671
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Muhammed Hussein Karimi <[email protected]>
- Loading branch information
1 parent
432a48c
commit 31e7623
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# JSON | ||
|
||
To use JSON inputs use `dict` as Argument type | ||
|
||
it will do something like | ||
|
||
```python | ||
import json | ||
|
||
data = json.loads(user_input) | ||
``` | ||
|
||
## Usage | ||
|
||
You will get all the correct editor support, attributes, methods, etc for the dict object:` | ||
|
||
//// tab | Python 3.7+ | ||
|
||
```Python hl_lines="5" | ||
{!> ../docs_src/parameter_types/json/tutorial001.py!} | ||
``` | ||
|
||
//// | ||
|
||
Check it: | ||
|
||
<div class="termy"> | ||
|
||
```console | ||
// Run your program | ||
$ python main.py --user-info '{"name": "Camila", "age": 15, "height_meters": 1.7, "female": true}' | ||
|
||
User Info: {"name": "Camila", "age": 15, "height_meters": 1.7, "female": true} | ||
|
||
``` | ||
|
||
</div> |