Can you use python in xcode




















Could not load branches. Could not load tags. Latest commit. Git stats 3 commits. Failed to load latest commit information. Add screenshots. Jan 13, Initial commit. Add steps to create a python project. View code. Now you can start writing Python code: Run it!

MIT License. I started wondering if it was possible to use Xcode to code python, the answers "Yes", but it requires a little setting up to do.

After a fair bit of online searching I managed to put together a set of instructions that I thought I'd share. I'm using Anaconda so the first thing is to get the path to Python. Open up a Terminal window and type. Now open Xcode and choose "Create a new Xcode project", in the resulting dialog select the "Other" tab and then "External Build System".

Click Next. If not, go there. Name your file Whatever. I went with Work. Click Create. I warn you now that this step is going to be delicate, fragile, and stupid.

In the Info tab. A file selection dialog appears. Return to the terminal. Select Show Original. This will probably be named python3. Drag python3. If so, great. If not, you need to work around Xcode: create a hard link and then drag the link onto the dialog. I know, I know. Better solution? Let me know. Now, click the Arguments tab. Click Close to dismiss the scheme editor. Clearly Swift has inherited a lot of Python genes.

It also feels sinful to use such lax typing without compiler oversight. That said, my first experiences in Python can wait for another day and another post. More to follow. Also, Sierra does have Python 3. My Sierra install does not have Python 3. Xcode is not as grumpy about the symbolic link being used as it pretends to be.



0コメント

  • 1000 / 1000