Skip to content

Commit adb289c

Browse files
committed
feat: 添加博文《Python 起步》
1 parent 87ea73d commit adb289c

File tree

7 files changed

+66
-6
lines changed

7 files changed

+66
-6
lines changed

.vitepress/data/docs.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@axolo/blog",
3-
"version": "0.3.7",
3+
"version": "0.3.8",
44
"description": "Yueming Fang's blog. powered by vitepress",
55
"author": "Yueming Fang",
66
"license": "MIT",
@@ -30,9 +30,9 @@
3030
"@axolo/tree-array": "^0.6.0",
3131
"@mermaid-js/mermaid-mindmap": "^9.3.0",
3232
"dayjs": "^1.11.13",
33-
"mermaid": "^11.4.1",
34-
"sass": "^1.83.0",
35-
"vitepress": "^1.5.0",
33+
"mermaid": "^11.5.0",
34+
"sass": "^1.86.0",
35+
"vitepress": "^1.6.3",
3636
"vitepress-plugin-mermaid": "^2.0.17"
3737
}
3838
}

src/archive.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ unsave: true
66

77
# 归档
88

9+
## 2025
10+
11+
- [Python 起步](./python-start.md)
12+
913
## 2024
1014

1115
- [JavaScript 打包发布](./javascript-publish.md)

src/category.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ unsave: true
6868

6969
- [Egg.js 实现 OAuth2 授权码方式鉴权](./egg-oauth.md)
7070
- [有感于《论PHP的倒掉》](./php-fall.md)
71+
- [Python 起步](./python-start.md)
7172
- [LeoPHP Framework](./leophp.md)
7273
- [php_imagick安装配置](./php-imagick-windows.md)
7374
- [MVC及PHP++、PHP--胡思乱想杂记](./php-lite.md)

src/php-lite.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ Cache又是一个什么概念呢?一个简单的例子,商品分类列表,
2828

2929
最近AD挺多,顺路也AD一下:你的PHP--了么?
3030

31-
> 注:PHP-Client、PHP-Controler、PHP-Db等都是作者发明的名词,非专业通用名词
31+
> 注:PHP-Client、PHP-Controler、PHP-Db等都是作者发明的名词,非专业通用名词

src/python-start.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Python 起步
3+
description: 关于 Python 的正确起步方式。
4+
time: 2025-03-21
5+
category: 后端
6+
tags: [Python]
7+
---
8+
9+
# Python 起步
10+
11+
关于 Python 的正确起步方式。
12+
13+
## Ubuntu
14+
15+
`bash`为例:
16+
17+
```bash
18+
# 安装 python3 和 venv
19+
apt install python3 python3-venv
20+
# 设置 python3 为默认 python
21+
update-alternatives --install /usr/bin/python python /usr/bin/python3 150
22+
# 设置 pip 源,配置文件位于:~/.config/pip/pip.conf
23+
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
24+
# 创建虚拟环境目录,推荐在用户文件夹下
25+
mkdir -p ~/.python && cd ~/.python
26+
# 创建虚拟环境
27+
python -m venv dev
28+
# 激活虚拟环境
29+
source ./dev/bin/activate
30+
# 退出虚拟环境
31+
./dev/bin/deactivate
32+
```
33+
34+
## Windows
35+
36+
`PowerShell`为例:
37+
38+
```powershell
39+
# 安装 python3(自带 pip 和 venv),若下载安装请启用:Disable path length limit
40+
winget install Python.Python.3.13
41+
# 设置 pip 源,配置文件位于:$env:USERPROFILE\AppData\Roaming\pip\pip.ini
42+
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
43+
# 创建虚拟环境目录,推荐在用户文件夹下
44+
cd $env:USERPROFILE\AppData\Roaming ; md python ; cd python
45+
# 创建虚拟环境
46+
python -m venv dev
47+
# 激活虚拟环境
48+
.\dev\Scripts\Activate.ps1
49+
# 退出虚拟环境
50+
.\dev\Scripts\deactivate.bat
51+
```

src/tag.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ unsave: true
166166

167167
- [Egg.js 实现 OAuth2 授权码方式鉴权](./egg-oauth.md)
168168

169+
## Python
170+
171+
- [Python 起步](./python-start.md)
172+
169173
## cors
170174

171175
- [nginx 同源调试](./nginx-cors.md)

0 commit comments

Comments
 (0)