2011年5月11日水曜日

xcode4でpythonを使う

参考したURLが英語だったので日本語に訳す。

  1. Xcode4を開く
  2. メニューバー→File→New→New Projectと選ぶ
  3. Mac OSXの範囲にあるOtherを選ぶ
  4. External Build Systemを選んでNext
  5. 任意のProduct nameを入力する
  6. Build Toolに/usr/local/bin/python3、/usr/bin/python等とpythonの位置を指定してNext
  7. 任意の保存場所を指定してCreate

 

 

  1. メニューバー→File→New→New Fileと選ぶ
  2. Mac OSXの範囲にあるOtherを選ぶ
  3. Emptyを選んでNext
  4. 任意の保存するディレクトリをえらんで.pyのpython形式でファイル名を指定してSave

 

  1. メニューバー→Product→Edit Schemeと選ぶ
  2. 左側にあるRunという項目をクリックする
  3. infoタブにあるExecutableをOtherに変更
  4. ⇧⌘Gと押すと隠しフォルダを指定して移動できるのでExternal Build Systemとして指定したファイルを指定(この方法は今回初めて知った!!便利>o<)
  5. Debuggerの項目はNoneに変更
  6. Base Expansions Onの項目に作成したproduct nameを指定
  7. Arguments Passed On Launchの項目の下にある+ボタンをクリックして・・・

ここからわからん。。。。w

一度保留して、hello worldを試してみたけど、xcodeがすぐ落ちる。。。

だれか、教えて〜〜〜><

  1. Click the "+" icon under "Arguments Passed On Launch". You may have to expand that section by clicking on the triangle pointing to the right.
  2. Type in "$(SOURCE_ROOT)/" without the quotes 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.
  3. Click "OK".
  4. Start coding.

原文:http://stackoverflow.com/questions/5276967/python-in-xcode-4

0 件のコメント:

コメントを投稿