代码片段库

经过测试、可直接复制的 Python、Flask、JavaScript、SQL、HTML、CSS 和 Bash 代码片段,都可以在代码游乐场中打开。

3 个代码片段

python

Read a JSON file with clear errors

Load a JSON file and get a readable message when it is missing or malformed.

beginner #json#files#errors
flask

Safe file upload

Check the extension, size and filename before saving an upload.

intermediate #uploads#security#files
python

Read and write CSV files

Read rows as dicts and write a filtered copy with csv.DictWriter.

beginner #csv#files#data