Skip to content

Instantly share code, notes, and snippets.

View and2long's full-sized avatar
🏠
Working from home

Lilong Zhang and2long

🏠
Working from home
View GitHub Profile
@and2long
and2long / ddbjson-to-json.py
Last active May 19, 2023 01:47
将 DynamoDB json 数据转换成普通 json 数据。
from boto3.dynamodb.types import TypeDeserializer, TypeSerializer
def from_dynamodb_to_json(item):
d = TypeDeserializer()
return {k: d.deserialize(value=v) for k, v in item.items()}
@and2long
and2long / python-formatting-blackArgs.json
Created September 6, 2021 03:34
python black config.
"python.formatting.provider": "black",
"python.formatting.blackArgs": [
"--skip-string-normalization"
]
@and2long
and2long / rename_files.py
Created January 12, 2022 06:06
重命名当前文件夹下的所有文件。
import os
import sys
# 重命名当前文件夹下的所有文件。
path = os.path.dirname(os.path.realpath(__file__))
print(path)
onlyfiles = [
f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f)) and not f.startswith(".")
]