google / google/python-fire

How can I get json param

オープン
#297 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
question
主要言語
Python
スター
28.2k
フォーク
1.5k
PR マージ指標
30日以内にマージされた PR はありません

説明

`test.py`
```
import fire

def hello(name):
print(name)
print(name.get('a'))

if __name__ == "__main__":
fire.Fire(hello)
```
example:
```
python test.py '{"a":"aaa","b":[1,2,3]}'
```
the param `name` is json dict, result print:
```
{'a':'aaa','b':[1,2,3]}
'aaa'
```
but when input:
```
python test.py '{"a":"aa.a","b":[1,2,3]}'
```
the param `name` can't parse to json, it's a `str`,how can I get the json param??
```
{a:aa.a,b:[1,2,3]}
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。