How to Use Python in XCode
Learn how to use python in Xcode. We will teach you how to create a new xcode project, specify bin directory, edit the scheme and eventually view the output.
Don't forget to check out our site http://howtech.tv/ for more free how-to videos!
http://youtube.com/ithowtovids - our feed
http://www.facebook.com/howtechtv - join us on facebook
https://plus.google.com/103440382717658277879 - our group in Google+
In this tutorial, we will teach you how to use Python in Xcode.
In this tutorial, you'd have to have python installed on your macbook. We are assuming that you have already downloaded and installed Python in Mac.
Step 1 -- Create a new Xcode Project
Follow this step by step guide to learn how to use python using Xcode. So let's start off by first launching the Xcode application.
Once the welcome screen appears, click on the "Create a new Xcode Project" option to get started.
Step 2 -- Choose a template
Now you would be required to choose a template for the new project. For the purpose of this tutorial, we will choose the "external Build System" template available in the "Other" section.
Step 3 -- Enter product name & build tool
In the next step, just give your project a name and do remember to specify the "bin" directory of python in the Build tool field at the bottom. To see where the python's bin directory is present, just open up the terminal application, type "which python" and hit enter. You can copy the complete path from there only.
Moving on, you would be required to specify the location where the project is to be saved. For the purpose of this tutorial, we will save it on the desktop.
Step 4 -- Edit Scheme
Now we need to prepare a specific scheme that would allow a file, on which we will be working on later, to be passed to the Python Interpreter.
For that, we will need open the Product menu, go to Scheme and then click on the Edit Scheme option.
Step 5 -- Locate python executable file
Make sure you're in the Run section and over there, open up the Info tab. Now since we need to connect to the python binary, we will open the executable menu and click on the other option.
Now all you have to do is locate and select the python executable file and that's it.
After that, do remember to choose the "none" option for Debugger.
Step 6 -- Type file name
Next, open up the Arguments tab and just type the filename with the .py extension under the "Arguments passed on launch" section.
Step 7 -- Use custom working directory
Once you are done, open up the options tab and select the "use Custom Working Directory" option. Over here, we will specify the same location where we saved the project earlier.
Step 8 -- Create a new empty template
With that done, we are basically finished with editing the schemes. Now let's create a new empty template to work on.
Here, specify the same file name in the save as field, which we specified in the Arguments tab.
Do remember to tick on the checkbox next to the target file over there and then click on the Create button.
Step 9 -- View output
Now we will simply print the text on the screen. For that, we will use the print keyword along with the message that is to be printed.
Now let's run the code and see how the output appears. In this manner, you can use python. And in the image below, you can see that the text we included in quotes is appearing on the screen as the output.
In this manner, you can use python in Xcode.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «How to Use Python in XCode», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.