| Reply | « Previous Thread | Next Thread » |
|
I am newbie in Python, and though i´ve been reading all documentation i´ve been able to, i haven´t found any issue concerning with dinamically Symbian C++ libraries loading.
I am not sure if i must use init functions and Py_InitModule () as C. Have anyone done a functional extension of Python with these kind of libraries?. Any help will be appreciated. Thanks in advance |
|
I don't quite understand what you mean by loading Symbian C++ libraries dynamically. Can you be more specific?
|
|
Just imagine i extend Python using a Symbian DLL, for instance, a polymorphic DLL.How can i load this library?, must my Symbian DLL implement a specific interface?. Hope this clarify my question. Thanks!
|
|
Check out the 1.1.6 release. A minimal example extension is included.
|
|
Do you mean 1.6.1 (September 2000)???.
Oldest python version available is 1.5.2, isn´t it?? Thanks for your response! |
|
No, I'm referring to Python for Series 60 release 1.1.6 which came out this summer. It's built on Python interpreter version 2.2.2.
|
|
Unfortunately using ctypes would be quite problematic. All interesting Symbian API's are C++ and ctypes is built with C in mind. To create C++ objects to pass as parameters you would need to parse the headers with a real C++ compiler and this would be much more complicated than for C. An additional inconvenience is that Symbian DLL's don't include function names, just ordinals, so you would have to pregenerate the naming information for the SDK libraries beforehand.
|
|
Quote:
|
|
I know how to load a Symbian DLL from Symbian. My doubt was related to load those libraries from Python. I have many modules (Symbian DLL Libraries) made on Symbian and i would like to reuse them from Python.
Thanks anyway for your response |
|
Quote:
So, the call sequence will be following: Python->Python C++ wrapper->Your C++ Library. For instructions how to implement the wrapper, please see API doc, appendix C. |
| simo.salminen |
| View Public Profile |
| Find all posts by simo.salminen |
|
Ok thank you!, that´s what i needed!.
Let me have a look and find out if it resolves my doubts, but it sounds very well. |
|
This previous post that shows exactly how to implement a wrapper: http://discussion.forum.nokia.com/fo...ad.php?t=65720
|
| simo.salminen |
| View Public Profile |
| Find all posts by simo.salminen |
|
Quote:
|
|
Quote:
![]() It's very great ![]() I packed the missing ctypes (pure python) and put it on my site. Now I can use the testing code ![]() Code:
import ctypes
import _ctypes
h = _ctypes.dlopen("libcrypto.dll")
try:
print type(h)
sha = _ctypes.dlsym(h, "1491")
init = _ctypes.dlsym(h, "1493")
update = _ctypes.dlsym(h, "1495")
final = _ctypes.dlsym(h, "1492")
print [sha, init, update, final]
data = "digestible message"
result = ctypes.create_string_buffer(20)
_ctypes.call_function(sha, (data, len(data), result))
print ctypes.sizeof(result), repr(result.raw)
finally:
_ctypes.dlclose(h)
"""
To do the same with the Python "sha" library:
import sha
result = sha.new("digestible message").digest()
print len(result), repr(result)
"""
links : ctypes 1.0.2 3rd (without _ctypes.pyd !) Cyke64 pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/ |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Current Symbian Development Opportunities...!! | mobile2004 | General Symbian C++ | 0 | 2005-01-17 18:58 |
| GCC TOOLS to inspect Symbian DLL and LIB files? | jjclose | Symbian Tools & SDKs | 1 | 2004-11-18 17:54 |
| Global Symbian Development Opportunities *High Importance* | sara.lindsay | General Symbian C++ | 0 | 2004-05-21 12:16 |
| Global Symbian Development Opportunities *High Importance* | sara.lindsay | General Symbian C++ | 2 | 2004-05-08 10:09 |
| Global Symbian Development Opportunities *High Importance* | sara.lindsay | General Symbian C++ | 0 | 2004-05-07 12:45 |