PyJNIus在Python中調用Java方法
Pyjnius 是一個 Python 庫,為 Python 程序提供訪問 Java 類的方法,支持桌面和 Android 系統(tǒng)。
示例代碼:
>>> from jnius import autoclass
>>> Stack = autoclass('java.util.Stack')
>>> stack = Stack()
>>> stack.push('hello')
>>> stack.push('world')
>>> stack.pop()
'world'
>>> stack.pop()
'hello'評論
圖片
表情
