
1.2 第三方开发工具VS Code
Visual Studio Code(简称VS Code)是一款免费开源的现代化轻量级代码编辑器,几乎支持所有主流开发语言的代码调试,可作为Python的开发工具,安装时安装Python插件即可,VS Code的官网下载地址为https://code.visualstudio.com/Download。
打开网址,出现Visual Studio Code的下载页面,如图1.17所示。

图 1.17
根据需要选择下载版本,以Windows 64位系统为例,选择System Installer 64 bit,如图1.18所示。
选择保存路径,单击“下载”按钮,如图1.19所示。
下载完成后双击安装文件,选择“我接受协议”复选框,单击“下一步”按钮,如图1.20所示。

图 1.18

图 1.19

图 1.20
选择要安装文件夹的位置,单击“下一步”按钮,如图1.21所示。

图 1.21
选择开始菜单文件夹,单击“下一步”按钮,如图1.22所示。

图 1.22
选择“添加到PATH(重启后生效)”复选框,单击“下一步”按钮,如图1.23所示。

图 1.23
单击“安装”按钮,如图1.24所示。
单击“完成”按钮,如图1.25所示。
重启计算机,打开Visual Studio Code,安装扩展,如图1.26所示。
输入“python”搜索,单击Install按钮,如图1.27所示。
当按钮显示为Uninstall时,说明Python扩展安装结束,如图1.28所示。
输入“jupyter”搜索,单击Install按钮,如图1.29所示。
当按钮显示为Uninstall时,说明Jupyter扩展安装结束,如图1.30所示。

图 1.24

图 1.25

图 1.26

图 1.27

图 1.28

图 1.29

图 1.30
在菜单栏上选择File→New File新建文件,如图1.31所示。

图 1.31
新建一个未命名文件Untitled-1,如图1.32所示。

图 1.32
单击File→Save As命令更改文件类型,如图1.33所示。
不用修改文件名,单击第二个下拉框,如图1.34所示。

图 1.33

图 1.34
选择Jupyter类型,如图1.35所示。
单击“保存”按钮,如图1.36所示。
现在Jupyter Server的状态为Not Started,图标为红色,在单元格中输入代码print('hello'),单击其上边的绿色小三角形按钮,运行代码,如图1.37所示。

图 1.35

图 1.36

图 1.37
运行提示各种错误,如图1.38所示。

图 1.38
右下角提示Jupyter没有安装及Python解释器没有设置,单击Install按钮,如图1.39所示。

图 1.39
此时,提示选择Python解释器,单击Select Python Interpreter按钮,如图1.40所示。

图 1.40
选择D:\python3.7.5\python.exe,如图1.41所示。
继续安装Jupyter,如图1.42所示。
安装过程如图1.43所示。

图 1.41

图 1.42

图 1.43
安装结束,如图1.44所示。

图 1.44
将终端窗口关闭,这个窗口对以后的工作没有用,如图1.45所示。

图 1.45
稍等片刻,当Jupyter Server右侧的小图标由红色变为绿色时,说明Jupyter Server已经可以开始服务了,如图1.46所示。

图 1.46
单击三角形按钮运行代码,如图1.47所示。
运行成功,至此,工作平台搭建完毕,如图1.48所示。

图 1.47

图 1.48
最后调节Visual Studio Code的字体大小,选择File→Preferences→Settings,如图1.49所示。

图 1.49
设置字体大小,如图1.50所示。

图 1.50