Skip to content

Commit 6be1142

Browse files
walterclaude
authored andcommitted
修复死链 + nav 补全 + advanced 相对路径
- python9/2.md:替换缺失的 from···import 对比图为代码块(mkdocs build 死链) - mkdocs.yml:补 codeSpec/序、枚举类/序 入 nav(其他章节都有「序」) - advanced/advanced.md:绝对路径 /Article/... 改相对(mkdocs 不重写绝对链接会死链) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5a3e799 commit 6be1142

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

Article/PythonBasis/python9/2.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,20 @@ NameError: name 'version' is not defined
9292

9393
`from···import` 直接导入 version 属性
9494

95-
![from···importimport的区别2](media/from%C2%B7%C2%B7%C2%B7import%E5%92%8C%20import%E7%9A%84%E5%8C%BA%E5%88%AB2-2.png)
95+
```python
96+
#!/usr/bin/env python3
97+
# -*- coding: UTF-8 -*-
98+
99+
from sys import version
100+
101+
print(version) # 直接使用 version 属性,无需 sys. 前缀
102+
```
103+
104+
运行结果:
105+
106+
```
107+
3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)]
108+
```
96109

97110

98111

Article/advanced/advanced.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
* [使用Python虚拟环境](/Article/advanced/使用Python虚拟环境.md)
2-
* [Mac中使用virtualenv和virtualenvwrapper](/Article/advanced/Mac中使用virtualenv和virtualenvwrapper.md)
1+
* [使用 Python 虚拟环境](使用Python虚拟环境.md)
2+
* [Mac 中使用 virtualenv 和 virtualenvwrapper](Mac中使用virtualenv和virtualenvwrapper.md)

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ nav:
6060
- 首页: index.md
6161
- 为什么学 Python: PythonBasis/python0/WhyStudyPython.md
6262
- 代码规范:
63+
- : codeSpecification/codeSpecification_Preface.md
6364
- 简明概述: codeSpecification/codeSpecification_first.md
6465
- 注释: codeSpecification/codeSpecification_second.md
6566
- 命名规范: codeSpecification/codeSpecification_third.md
@@ -131,6 +132,7 @@ nav:
131132
- 自定义容器: PythonBasis/python10/5.md
132133
- 运算符魔术方法: PythonBasis/python10/6.md
133134
- 枚举类:
135+
- : PythonBasis/python11/Preface.md
134136
- 使用: PythonBasis/python11/1.md
135137
- Enum 源码: PythonBasis/python11/2.md
136138
- 自定义类型: PythonBasis/python11/3.md

0 commit comments

Comments
 (0)