mac是自带python2.7的,但是现在主流使用3.0及以上,确实python3比python2会更容易上手,也更方便操作。

电脑浏览器打开python官方网站:www.python.org/

当然,我也推荐你点击all releases,然后下载python3.7.0版本进行安装,本系列教程都将在这个版本下进行编写代码。

当然你也可以直接访问:www.python.org/downloads/r… 选择合适版本进行下载,一般选择下载安装包安装,如图圈红的两个安装包,一个是mac的,一个是windows下的。

1)mac下安装比较简单,直接双击下载好的安装包,然后一路点击next或者继续即可。

2)mac一般只有一个磁盘,所以安装位置默认即可。

3)点击安装按钮即可完成安装,同样的安装好后关闭安装窗口即可。

安装好后,mac直接打开终端,然后输入python3 --version即可看到自己安装好的python版本,然后输入python3,即可进入自带的代码编辑环境,我们可以尝试输入print('hello python!'),然后回车,看看效果。

记住这是你写下的第一行代码,欢迎进入代码世界。