Browse Source

add python

master
Markus Bergholz 3 years ago
parent
commit
c5f215434d
  1. 14
      til.md

14
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…
Cancel
Save