Question
I'm working with the Tizen SDK and trying to integrate several APIs (IBM Watson, an upcoming assistant API, and Emotient API) with Python in a Secure Multi-party Computation network. I'm having difficulties with Python in the SDK.
My questions are:
- Will Tizen have full Python support where I can add Python functions?
- Would you recommend focusing on native Tizen apps instead?
- How can I best use these APIs for new creative applications?
Answer
Problem Understanding
The user wants to integrate multiple third-party APIs with Python in the Tizen environment, specifically for Secure Multi-party Computation applications. They are experiencing challenges with Python support in the Tizen SDK and are seeking guidance on the best approach.
Solution Methods
-
Python Integration Options:
- Currently, there is no direct API to communicate with Python from native Tizen code
- Consider using Cython as a bridge between C and Python
- Evaluate if your application requirements can be met with native Tizen development instead
-
Recommended Approach:
- For complex Python integration needs, Cython can be used to bridge between native code and Python
- For better performance and native support, consider developing with Tizen's native APIs
- Evaluate whether the required functionality can be implemented using Tizen's native capabilities
-
API Implementation:
- Research each API's compatibility with Tizen's native environment
- Check if the APIs offer native SDKs or REST interfaces that can be used directly in Tizen applications
- Consider implementing the computation-heavy parts in native code and using Python only where necessary
Code Examples
While there are no direct code examples for this specific scenario, here's a general approach for using Cython:
# Example.pyx - Cython file
def compute(data):
# Your Python implementation
return result
// main.c - Native Tizen application
#include <Python.h>
void call_python_function() {
PyObject *pName, *pModule, *pFunc;
Py_Initialize();
pName = PyUnicode_DecodeFSDefault("Example");
pModule = PyImport_Import(pName);
pFunc = PyObject_GetAttrString(pModule, "compute");
// Call the function and process results
Py_Finalize();
}
Additional Tips
- Review the official Tizen documentation for the latest Python support status
- Consider the performance implications of using Python in a resource-constrained environment
- Test API compatibility thoroughly before committing to a specific implementation approach
- Join Tizen developer communities for more specific advice on your use case