Skip to content

Commit e4bb2da

Browse files
小王同学
1 parent 33d2dd2 commit e4bb2da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+8109
-0
lines changed

00_Python编辑器/01_Python编辑器推荐.ipynb

+132
Large diffs are not rendered by default.

00_Python编辑器/02_Jupyter Notebook安装.ipynb

+128
Large diffs are not rendered by default.

00_Python编辑器/03_Jupyter Notebook代码文件.ipynb

+210
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# 1. 常用快捷键"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"① Shift + 回车 运行当前代码块,并跳到下一个代码块\n",
15+
"\n",
16+
"② Ctrl + 回车 只运行当前代码块\n",
17+
"\n",
18+
"③ Alt + 回车 执行当前代码块,并且会新建一个代码块\n",
19+
"\n",
20+
"④ 选中它,按A键(Above),在上方新建一个代码块\n",
21+
"\n",
22+
"⑤ 选中它,按B键(Blow),在下方新建一个代码块\n",
23+
"\n",
24+
"⑥ 命令模式时,对单元格按M,变成markdown单元格,按Y,切换回代码单元格。"
25+
]
26+
},
27+
{
28+
"cell_type": "markdown",
29+
"metadata": {},
30+
"source": [
31+
"① markdown 模式中,# 表示1号标题,#与标题之间有空间\n",
32+
"\n",
33+
"② markdown 模式中,## 表示2号标题,#与标题之间有空间\n",
34+
"\n",
35+
"③ markdown 模式中,### 表示3号标题,#与标题之间有空间\n",
36+
"\n",
37+
"④ X 剪切该代码块\n",
38+
"\n",
39+
"⑤ Shift + V 将剪切的代码段放到该代码段上面\n",
40+
"\n",
41+
"⑥ V 将剪切的代码段放到该代码段下面"
42+
]
43+
},
44+
{
45+
"cell_type": "markdown",
46+
"metadata": {},
47+
"source": [
48+
"① 一个美元符号 $单行公式\n",
49+
"\n",
50+
"② 两个美元符号 $$双行公式\n",
51+
"\n",
52+
"③ 在命令模式,按L,可以给代码表行数\n",
53+
"\n",
54+
"④ 回车 从命令模式变成编辑模式\n",
55+
"\n",
56+
"⑤ Esc 从编辑模式退回命令模式\n",
57+
"\n",
58+
"⑥ 插入图片:首先要将图片放入该代码文件所在的文件夹下,即与代码文件处于同级目录,然后查看图片的名字以及后缀,然后在markdown模式,输入代码:$![](aa.jpg)$,aa是图片名字,jpg是图片格式,[]中间没有空格,代码输入后点击运行,即可插入该文件夹中的图片。"
59+
]
60+
},
61+
{
62+
"cell_type": "markdown",
63+
"metadata": {},
64+
"source": [
65+
"# 2. 设置表格"
66+
]
67+
},
68+
{
69+
"cell_type": "markdown",
70+
"metadata": {},
71+
"source": [
72+
"① 每一行的两个元素之间用竖线进行了分隔,在表头行的下方额外添加了一行,该行的所有元素都是3个中划线。\n",
73+
"\n",
74+
"② 表格中的所有单元格默认都是右对齐的。\n",
75+
"\n",
76+
"③ 可以指定某一列的所有单元格的对齐方式,比如将第2列指定为左对齐,那就可以在第2列的中划线的前面添加1个冒号,将第3列指定为右对齐,那就在第3列的中划线后面添加1个冒号,将第4列指定为居中对齐,那就在第4列的中划线的前面和后面各添加1个冒号。"
77+
]
78+
},
79+
{
80+
"cell_type": "markdown",
81+
"metadata": {},
82+
"source": [
83+
"| 左对齐标题 | 右对齐标题 | 居中对齐标题 |\n",
84+
"| :------| ------: | :------: |\n",
85+
"| 短文本 | 中等文本 | 稍微长一点的文本 |\n",
86+
"| 稍微长一点的文本 | 短文本 | 中等文本 |"
87+
]
88+
},
89+
{
90+
"cell_type": "markdown",
91+
"metadata": {},
92+
"source": [
93+
"# 3. 划线删掉"
94+
]
95+
},
96+
{
97+
"cell_type": "markdown",
98+
"metadata": {},
99+
"source": [
100+
"~一整段话划线删掉~"
101+
]
102+
}
103+
],
104+
"metadata": {
105+
"kernelspec": {
106+
"display_name": "Python 3.6.3",
107+
"language": "python",
108+
"name": "python3.6.3"
109+
},
110+
"language_info": {
111+
"codemirror_mode": {
112+
"name": "ipython",
113+
"version": 3
114+
},
115+
"file_extension": ".py",
116+
"mimetype": "text/x-python",
117+
"name": "python",
118+
"nbconvert_exporter": "python",
119+
"pygments_lexer": "ipython3",
120+
"version": "3.6.3"
121+
},
122+
"toc": {
123+
"base_numbering": 1,
124+
"nav_menu": {},
125+
"number_sections": false,
126+
"sideBar": true,
127+
"skip_h1_title": false,
128+
"title_cell": "Table of Contents",
129+
"title_sidebar": "Contents",
130+
"toc_cell": false,
131+
"toc_position": {
132+
"height": "calc(100% - 180px)",
133+
"left": "10px",
134+
"top": "150px",
135+
"width": "330.969px"
136+
},
137+
"toc_section_display": true,
138+
"toc_window_display": true
139+
}
140+
},
141+
"nbformat": 4,
142+
"nbformat_minor": 4
143+
}

00_Python编辑器/05_Jupyter Notebook美化.ipynb

+157
Large diffs are not rendered by default.

01_输出函数print.ipynb

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# 1. 输出函数print"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": 1,
13+
"metadata": {},
14+
"outputs": [
15+
{
16+
"name": "stdout",
17+
"output_type": "stream",
18+
"text": [
19+
"520\n",
20+
"98.5\n",
21+
"hello world\n",
22+
"hello world\n",
23+
"4\n",
24+
"hello world Python\n"
25+
]
26+
}
27+
],
28+
"source": [
29+
"# 输出数字\n",
30+
"print(520)\n",
31+
"print(98.5)\n",
32+
"\n",
33+
"# 输出字符串\n",
34+
"print('hello world') # 单引号内内容直接输出\n",
35+
"print(\"hello world\") # 双引号内内容直接输出\n",
36+
"\n",
37+
"# 输出计算后内容 \n",
38+
"print(3 + 1) # 含有运算符的表达式,会计算\n",
39+
"\n",
40+
"# 输出数据到文件当中\n",
41+
"fp = open('D:/test.txt', 'a+') # 输出在文件中,a+表示以读写功能创建,文件不存在就创建,存在的话就在文件内容后继续追加\n",
42+
"print('hello world', file=fp) # # A.所指定的盘符必须存在 B.使用file=fp 把打印内容输出到fp当中,不用file的话文件里没有东西\n",
43+
"fp.close() \n",
44+
"\n",
45+
"# 不进行换行输出(输出内容在一行当中) 用逗号进行分隔\n",
46+
"print('hello', 'world', 'Python')"
47+
]
48+
}
49+
],
50+
"metadata": {
51+
"kernelspec": {
52+
"display_name": "Python 3.6.3",
53+
"language": "python",
54+
"name": "python3.6.3"
55+
},
56+
"language_info": {
57+
"codemirror_mode": {
58+
"name": "ipython",
59+
"version": 3
60+
},
61+
"file_extension": ".py",
62+
"mimetype": "text/x-python",
63+
"name": "python",
64+
"nbconvert_exporter": "python",
65+
"pygments_lexer": "ipython3",
66+
"version": "3.6.3"
67+
},
68+
"toc": {
69+
"base_numbering": 1,
70+
"nav_menu": {},
71+
"number_sections": false,
72+
"sideBar": true,
73+
"skip_h1_title": false,
74+
"title_cell": "Table of Contents",
75+
"title_sidebar": "Contents",
76+
"toc_cell": false,
77+
"toc_position": {},
78+
"toc_section_display": true,
79+
"toc_window_display": true
80+
}
81+
},
82+
"nbformat": 4,
83+
"nbformat_minor": 4
84+
}

02_转义字符与原字符.ipynb

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# 1. 转义字符与原字符"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": 1,
13+
"metadata": {},
14+
"outputs": [
15+
{
16+
"name": "stdout",
17+
"output_type": "stream",
18+
"text": [
19+
"hello\n",
20+
"world\n",
21+
"hello\tworld\n",
22+
"helloooo\tworld\n",
23+
"hello\r",
24+
"world\n",
25+
"hello\bworld\n",
26+
"http:\\\\www.baidu.com\n",
27+
"老师说:\\‘大家好\\\n",
28+
"hello\\n world\n",
29+
"hello\\n world\\\\\n"
30+
]
31+
}
32+
],
33+
"source": [
34+
"# 转义字符\n",
35+
"print('hello\\nworld') # \\+转义功能的首字符 n--newline的首字符表示换行\n",
36+
"\n",
37+
"print('hello\\tworld') # \\t用了三个位置\n",
38+
"\n",
39+
"print('helloooo\\tworld') # \\t用了四个位置\n",
40+
"\n",
41+
"print('hello\\rworld') # return 回车 只剩下world将hello进行了覆盖\n",
42+
"\n",
43+
"print('hello\\bworld') # back 退格 少一个o\n",
44+
"\n",
45+
"print('http:\\\\\\\\www.baidu.com') # \\\\打印出来是一个\\\n",
46+
"\n",
47+
"print('老师说:\\‘大家好\\’') # \\是转义字符\n",
48+
"\n",
49+
"print(r'hello\\n world') # 原字符,不希望字符串中的转义字符起作用,就使用原字符,就是在字符串之前加上r或R\n",
50+
"\n",
51+
"#print(r'hello\\n world\\') # 最后一个字符不能是反斜线\\\n",
52+
"print(r'hello\\n world\\\\') # 最后一个字符可以是两个\\\\"
53+
]
54+
}
55+
],
56+
"metadata": {
57+
"kernelspec": {
58+
"display_name": "Python 3.6.3",
59+
"language": "python",
60+
"name": "python3.6.3"
61+
},
62+
"language_info": {
63+
"codemirror_mode": {
64+
"name": "ipython",
65+
"version": 3
66+
},
67+
"file_extension": ".py",
68+
"mimetype": "text/x-python",
69+
"name": "python",
70+
"nbconvert_exporter": "python",
71+
"pygments_lexer": "ipython3",
72+
"version": "3.6.3"
73+
},
74+
"toc": {
75+
"base_numbering": 1,
76+
"nav_menu": {},
77+
"number_sections": false,
78+
"sideBar": true,
79+
"skip_h1_title": false,
80+
"title_cell": "Table of Contents",
81+
"title_sidebar": "Contents",
82+
"toc_cell": false,
83+
"toc_position": {},
84+
"toc_section_display": true,
85+
"toc_window_display": true
86+
}
87+
},
88+
"nbformat": 4,
89+
"nbformat_minor": 4
90+
}

03_二进制与字符编码.ipynb

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# 1. 二进制与字符编码"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": 1,
13+
"metadata": {},
14+
"outputs": [
15+
{
16+
"name": "stdout",
17+
"output_type": "stream",
18+
"text": [
19+
"\n",
20+
"20056\n"
21+
]
22+
}
23+
],
24+
"source": [
25+
"print(chr(0b100111001011000)) # 0b表示为十六进制\n",
26+
"\n",
27+
"print(ord('乘')) # 十进制为20056"
28+
]
29+
}
30+
],
31+
"metadata": {
32+
"kernelspec": {
33+
"display_name": "Python 3.6.3",
34+
"language": "python",
35+
"name": "python3.6.3"
36+
},
37+
"language_info": {
38+
"codemirror_mode": {
39+
"name": "ipython",
40+
"version": 3
41+
},
42+
"file_extension": ".py",
43+
"mimetype": "text/x-python",
44+
"name": "python",
45+
"nbconvert_exporter": "python",
46+
"pygments_lexer": "ipython3",
47+
"version": "3.6.3"
48+
},
49+
"toc": {
50+
"base_numbering": 1,
51+
"nav_menu": {},
52+
"number_sections": false,
53+
"sideBar": true,
54+
"skip_h1_title": false,
55+
"title_cell": "Table of Contents",
56+
"title_sidebar": "Contents",
57+
"toc_cell": false,
58+
"toc_position": {},
59+
"toc_section_display": true,
60+
"toc_window_display": true
61+
}
62+
},
63+
"nbformat": 4,
64+
"nbformat_minor": 4
65+
}

0 commit comments

Comments
 (0)