在xcode中编辑运行python代码

本文详细介绍了在MacOS系统中设置并运行Python项目的步骤,包括新建项目、创建Python文件、配置构建工具、设置运行方案等关键操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://www.douban.com/group/topic/22765904/


http://www.zhihu.com/question/19872198


In the menu bar, click "File" → "New" → "New Project…".
- Select "Other" under "Mac OS X".
- Select "External Build System" and click "Next".
- Enter the product name.
- For the "Build Tool" field, type in FULL path of your python and then click "Next".
Choose where to save it and click "Create".
- In the menu bar, click "File" → "New" → "New File…".
- Select "Other" under "Mac OS X".
- Select "Empty" and click "Next".
- Navigate to the project folder (it will not work, otherwise)
- Enter the name of the Python file (include the ".py" extension), and click "Save".
- In the menu bar, click "Product" → "Edit Scheme…".
- Click "Run" in the left column.
- In the "Info" tab, click the "Executable" field and then click "Other…".
- Navigate to the executable of your python. You may need to use ⇧⌘G to type in the directory if it is hidden.
- Select the executable and click "Choose".
- For the "Debugger" field, select "None".
- In the "Arguments" tab, click the "Base Expansions On" field and select the target you created earlier.
- Click the "+" icon under "Arguments Passed On Launch". You may have to expand that section by clicking on the triangle pointing to the right.
Type in "$(SOURCE_ROOT)/" and then the name of the Python file you want to test.
- Remember, the Python program must be in the project folder. Otherwise, you will have to type out the full path here.
- Click "OK".
- Start coding.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值