Using PyObjC, you can use Python to write Cocoa applications for OS X. Can I write native iPhone apps using Python and if so, how?
Not currently, currently the only languages available to access the iPhone SDK are C/C++ and Objective C.
There is no technical reason why this could not change in the future but I wouldn't hold your breath for this happening in the short term.
That said, Objective C really isn't that scary...
You can use PyObjC on the iPhone as well, due to the excellent work by Jay Freeman (saurik). See iPhone Applications in Python.
Note that this requires a jailbroken iPhone at the moment.
The iPhone SDK agreement is also rather vague about whether you're even allowed to run scripting languages (outside of a WebView's Javascript). My reading is that it is OK - as long as none of the scripts you execute are downloaded from the network (so pre-installed and user-edited scripts seem to be OK).
IANAL etc etc.
Newer versions of the iPhone SDK licensing agreement disallow jailbreaking. So while it is possible to do what you are looking to accomplish, there is no legal way to do it at the moment.
You can do this with PyObjC, with a jailbroken phone of course. But if you want to get it into the App Store, they will not allow it because it "interprets code." However, you may be able to use Shed Skin, although I'm not aware of anyone doing this. I can't think of any good reason to do this though, as you lose dynamic typing, and might as well use ObjC.
Yes you can. You write your code in tinypy (which is restricted Python), then use tinypy to convert it to C++, and finally compile this with XCode into a native iPhone app. Phil Hassey has published a game called Elephants! using this approach. Here are more details,
http://www.philhassey.com/blog/2009/12/23/elephants-is-free-on-the-app-store/
Edit: Another recent update to the Developer Agreement means that you can use whatever you like, as long as you meet the developer guidelines. Section 3.3.1 has been entirely removed.
Source: http://daringfireball.net/2010/09/app_store_guidelines
--
A recent update to the iPhone Developer Agreement for iPhone OS 4 means that apps must be originally written in either Objective C, C++, C or Javascript as executed by WebKit.
3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).
This means that apps created using Python would not be approved for the App Store.
Source: http://daringfireball.net/2010/04/iphone_agreement_bans_flash_compiler
Technically, as long as the interpreted code ISN'T downloaded (excluding JavaScript), the app may be approved. Rhomobiles "Rhodes" framework does just that, bundling mobile Ruby, a lightweight version of Rails, and your app for distribution via the app-store. Because both the interpreter and the interpreted code are packaged into the final application - Apple doesn't find it objectionable.
http://rhomobile.com/products/rhodes/
Even after the latest apple press release - rhodes apps (mobile ruby) are still viable on the app-store. I'd find it hard to believe that tinyPy or pyObjC wouldn't find a place if there is a willing developer community.
It seems this is now something developers are allowed to do: the iOS Developer Agreement was changed yesterday and appears to have been ammended in a such a way as to make embedding a Python interpretter in your application legal:
SECTION 3.3.2 — INTERPRETERS
Old:
3.3.2 An Application may not itself install or launch other executable code by any means, including without limitation through the use of a plug-in architecture, calling other frameworks, other APIs or otherwise. Unless otherwise approved by Apple in writing, no interpreted code may be downloaded or used in an Application except for code that is interpreted and run by Apple’s Documented APIs and built-in interpreter(s). Notwithstanding the foregoing, with Apple’s prior written consent, an Application may use embedded interpreted code in a limited way if such use is solely for providing minor features or functionality that are consistent with the intended and advertised purpose of the Application.
New:
3.3.2 An Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exception to the foregoing is scripts and code downloaded and run by Apple’s built-in WebKit framework.
I'm wondering - why would it be advantageous to program in python? Apple has gained great advantage my having almost all of their iphone apps programmed in Obj C. Standardization makes for the best environment for collaboration/competition.