瀏覽代碼

add python

master
Markus Bergholz 2 年之前
父節點
當前提交
c5f215434d
共有 1 個檔案被更改,包括 14 行新增0 行删除
  1. +14
    -0
      til.md

+ 14
- 0
til.md 查看文件

@@ -317,3 +317,17 @@ aws_secret_access_key = ...
and do

./goofys --endpoint ams3.digitaloceanspaces.com melmac /home/ec2-user/t/

# python

Python json dump with datetime. every time `JSON` doesn't know how to convert a value, it calls
the `default()` function.

```
def dtconverter(o):
if isinstance(o, datetime.datetime):
return o.__str__()

print(json.dumps(my_py_dict_var, default = dtconverter))

```

Loading…
取消
儲存