magic-python add one-line code

This commit is contained in:
2021-07-29 21:56:50 +08:00
parent 47df4cda71
commit c2b09ece24

View File

@@ -184,6 +184,22 @@ big {
# Output: ['a', 'b']
```
</section>
<section data-markdown>
### 文件中读入的字符莫名消失
复现代码
```python
raw = '第一行\n\r第二行'
for i in raw.split('\n'):
print('---start', i, 'end---')
# Output:
# ---start 第一行 end---
# 第二行 end---
```
</section>
<section data-markdown>
GOOD
@@ -229,7 +245,7 @@ big {
#### 没人知道这个变量是什么
- a, b, j, k, l
- str, string
- str, string, number, list, dict
- data
- data1
- data114514
@@ -279,6 +295,13 @@ big {
例如某个 `check_empty_in_list()`,按字面意思会检查列表中是否有空项,可这个函数在检查到空项的同时还会「智能地」帮你删掉空项。然而使用函数的人对此一无所知,函数作者也忘了有这么回事。
</section>
<section>
<p>一行!展现你的聪明才智!</p>
<code>
result = not os.system(' '.join(['proxychains', '-q', 'pandoc', 'README.md', 'SUMMARY.md', ' '.join([str(i)+'.md' for i in range(3, 109+1)]), '-o', '/tmp/out.epub']) or print("Failed")
</code>
</section>
</section>
<section>
<section style="text-align: left;" data-markdown>