markdown 放代码片

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 放代码片相关的知识,希望对你有一定的参考价值。

# 代码片

## utf头注释

```json
	"utf file header": {
		"prefix": "utf",
		"body": [
		  "# -*- coding: utf-8 -*-",
			"",
			"$0"
		],
		"description": "utf file header"
		},
```

## 获取soup对象

```json
	"get soup": {
		"prefix": "gsoup",
		"body": [
			"res = requests.get(url)",
			"res.encoding = 'utf-8'",
			"html = res.text",
			"page = BeautifulSoup(html, 'lxml')",
			"$1"
		],
		"description": "get BeautifulSoup"
	}
```

以上是关于markdown 放代码片的主要内容,如果未能解决你的问题,请参考以下文章