今天想使用一个IDE来开发Python,省的每次写完后都要在terminal上敲命令。选来选去,既然已经安装了Xcode就先用他吧。

那么怎么才能使用Xcode创建并运行Python文件呢?

必要准备:mac & Xcode


开发环境整理:


1.1 创建

creat

1.2 选择mac跨平台应用

select product

1.3 添加项目名称

add productName

2.1 添加文件

add file

2.2 Other > Empty

Other Empty” />

2.3 给文件命名

给文件命名 named

3.1 Product > Scheme > Edit Scheme

Edit Scheme

3.2 Run > info > Executable > Other

Executable

3.3 Command+Shift+G 定位文件路径Go to the folder:填写/usr/bin/python

path

3.4 确认选中的可执行文件

comfirm

3.5 确认Executable 选中python Debug executable 不用选中

Executable

3.6 Arguments > + >新建的文件名

Arguments

3.7 Options > Working Directory >项目路径

Working Directory 选择文件 select path

3.8 确认设置

comfirm

4 运行

print "hello world" run