calling Objective C functions from Python?

前端 未结 4 1723
刺人心
刺人心 2020-12-14 04:19

Is there a way to dynamically call an Objective C function from Python?

For example, On the mac I would like to call this Objective C function

[NSSpe         


        
4条回答
  •  温柔的废话
    2020-12-14 05:21

    Mac OS X from 10.5 onward has shipped with Python and the objc module that will let you do what you want.

    An example:

    from Foundation import *
    
    thing = NSKeyedUnarchiver.unarchiveObjectWithFile_(some_plist_file)
    

    You can find more documentation here.

提交回复
热议问题