xcode5 python 开发环境

在xcode5 下配置 python开发环境

1:默认mac下已经集成了python的开发库,先找到集成的python库的目录

    终端 which python

xcode5 python 开发环境

 记下当前的python 路径 /usr/bin/python

2: xcode 新建工程  ----OSX-----Other -----External Build System---Next

  填入工程名,并在 Build Tool 里面填入刚才找到的python 路径--Next

xcode5 python 开发环境

3:新建程序文件;

   Xcode---File----New-------OSX----Other----Empty----Next

   Save As  填入 hi.py 完成

xcode5 python 开发环境

4:配置 项目 Scheme

    打开项目 Edit Scheme

    Info栏修改如下:

    Executable 把 None 改为 Other 并在打开的框中,Command + Shift + G 调出填入路径框,输入上面的 python路径  /usr/bin/python   找到python Go 保存

    Debugger 由 LLDB 改为 None

xcode5 python 开发环境

 Arguments 栏目 Arguments Passed On Lanuch 点击 + 号添加,上面创建的 hi.py文件;

 Options 栏目里面的 Working Directory   勾选 Use Custom working directory 并在下面目录选择刚才创建hi.py所在的目录,其他就是 helloWorld工程目录

xcode5 python 开发环境

5:编辑 hi.py 开始写测试程序

 先来个 hello world

 print 'hello world'

commang + r 运行,就可以看到控制台的log输出了

xcode5 python 开发环境