Python环境搭建
Python环境搭建三部曲:
- 安装python
- 安装python编辑器pycharm
- 编写第一个python程序
安装Python
1、 点击链接进行下载: python官网
2、 下载完成后如下图所示
3、 双击exe文件进行安装,如下图,并按照圈中区域进行设置,切记要勾选打钩的框,然后再点击Customize installation进入到下一步:
4、对于下图中,可以通过Browse进行自定义安装路径,也可以直接点击Install进行安装,点击install后便可以完成安装了。
5、为了检查我们的python是否安装成功,可以在命令窗口中输入python进行查询,如显示下图一的信息则表示成功了,如显示第二张图的信息则表示出错了。
安装Python编辑器Pycharm
1、 首先从群文件下载pycharm:pycharm官网
2、下载完成之后如下图:
3、直接双击下载好的exe文件进行安装,安装截图如下:
点击Next进入下一步:
注意:选择32或者64取决你自己的系统,根据自己的实际位数选择
桌面会出现这样一个图形即可:
三、下面我们来创建自己的第一个程序
1、单击桌面上的pycharm图标,进入到pycharm中,如下图所示:
2、 我们选择第二个,然后点击Ok:
3、打开pycharm 点击Create New Project ,如下图:
如果已经打开了pycharm,则点击左上角 File – New Project
4、选择Pure Python,接下来要选择解释器了,如图:点击展开三角箭头
5、选择Existing interpreter
如果Existing interpreter 中显示的是如下图中的No interpreter ,则我们需要点击右边的三个点来添加一个本地的解释器。(如果显示已经有了,直接点击Create即可。)
这里是已经有了本地解释器的情况,如果你电脑显示如上图No interpreter,继续往下看
点击三个点来创建本地解释器,点开后如下图所示:
选择左边的System Interpreter ,如果如下图所示显示“No interpreter”,说明我们要手动选择一些我们安装的python(如果已经存在,直接点击OK。)
选择我们安装的python,如下图:
在我电脑上,我的安装位置是C:\Python36 (你们视自己安装位置确定)
选好后点击OK,如下图
再次点击Ok,返回创建项目,可以发现解释器已经配好了,点击Create创建项目即可(执行项目创建的位置,读者在Location里面自己确定)
编写第一个程序
菜单栏—file—new-----python file-----输入文件名(英文)----OK—
print(“helloworld!”)
编辑保存后,鼠标放在代码编辑区内(或者选中文件名)–>右键–>Run “你的文件名”
特别注意:
文件名不要输入:abc
附Pycharm激活码
L0BSUCJSTU-eyJ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