用终端命令执行.py 脚本,而无需使用python解释器
需要3步
(1)在python文件第一行添加 #!/usr/bin/env python
不管python库位于什么位置,都可以让你像运行普通程序一样运行脚本,如果安装了多个版本的python,可以将python换成 python2或python 3
(2)在终端,输入 chmod a +x /Users/admin327/Desktop/ZYN-Learning/python/MachineLearning/helloWorld.py (就是直接将你的脚本文件,helloWorld.py 拖进终端)
敲击回车键
(3)运行程序 (再将helloWorld.py 拖进来)

/Users/admin327/Desktop/ZYN-Learning/python/MachineLearning/helloWorld.py


点击回车 ,即可打印输出 hello!world
(然后发现这个问题是我好久之前看书的时候处理过的,啊脑子啊,一定要把做的东西写下来)