You Are Here:

Community: Developer Discussion Boards

Reply « Previous Thread | Next Thread »

#1 Old Using pyd lib in s603rd - 2006-08-05, 00:21

Join Date: Jul 2006
Posts: 42
Location: Kyiv(Ukraine)
Send a message via ICQ to Santehnik
Santehnik
Offline
Registered User
How to import pyd lib ?
I add this code
Quote:
import imp
_appswitch=imp.load_dynamic('_appswitch', 'c:\\python\\lib\\_appswitch.pyd')
But mobile says
Code:
Symbian Error: [Errno -1]
KErrNotFound
What i do wrong ?
Reply With Quote

#2 Old Re: Using pyd lib in s603rd - 2006-08-05, 14:17

Join Date: Jul 2006
Posts: 42
Location: Kyiv(Ukraine)
Send a message via ICQ to Santehnik
Santehnik
Offline
Registered User
SOME BODY HELP ME ?
Or say how i can put pyd file to SYS folder ?
Reply With Quote

#3 Old Re: Using pyd lib in s603rd - 2006-08-07, 05:12

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
Quote:
Originally Posted by Santehnik
SOME BODY HELP ME ?
Or say how i can put pyd file to SYS folder ?
Have you recompiled this module for 3rd Edition ?
If not then I think it doesn't work
First this module has appswitch name instead of _appswitch
Secondly you can put it in the c:\sys\bin folder
and try this
Code:
 appswitch=imp.load_dynamic('appswitch', 'c:\\sys\\bin\\appswitch.pyd')


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 With Quote

#4 Old Re: Using pyd lib in s603rd - 2006-08-07, 13:09

Join Date: Jul 2006
Posts: 42
Location: Kyiv(Ukraine)
Send a message via ICQ to Santehnik
Santehnik
Offline
Registered User
How to put ??? I can't! They says Unable Install (if i sign via devcert or selfsign)
You author of Keypress ??? can you recompile and send me your keypress module ?
Last edited by Santehnik : 2006-08-07 at 13:24.
Reply With Quote

#5 Old Re: Using pyd lib in s603rd - 2006-08-07, 16:24

Join Date: Dec 2004
Posts: 646
jplauril's Avatar
jplauril
Offline
Forum Nokia Expert
All native binaries (such as .pyd files) on 3rd edition must be in \sys\bin directory and the only way to install files there is by packaging it in a SIS file.

In addition, 3rd edition is binary incompatible with previous platform versions so all .pyd's must be at least recompiled. Other changes may also be necessary because of API changes that have occurred.
Reply With Quote

#6 Old Re: Using pyd lib in s603rd - 2006-08-08, 12:32

Join Date: Jul 2006
Posts: 42
Location: Kyiv(Ukraine)
Send a message via ICQ to Santehnik
Santehnik
Offline
Registered User
cyke64
Can you recompile your keypress module to S60 3RD edition and send me ? My Email Santehnik at mabila.ua
plz
thx
Reply With Quote

#7 Old Re: Using pyd lib in s603rd - 2006-08-08, 15:46

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
Quote:
Originally Posted by Santehnik
cyke64
Can you recompile your keypress module to S60 3RD edition and send me ? My Email Santehnik at mabila.ua
plz
thx
Sorry but I have only 2nd Edition SDK
But someone can compile it and make some changes ( if needed for 3rd compatibility ) to my source code keypress then it'll allow to all 3rd phones to run it


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/
Last edited by cyke64 : 2006-08-08 at 15:48. Reason: forgot link :(
Reply With Quote

#8 Old Re: Using pyd lib in s603rd - 2006-10-11, 11:15

Join Date: Oct 2006
Posts: 6
lakhsy
Offline
Registered User
Hi,

I have compiled keypress module for 3rd edition. Can anyone explain me how I could make it working on winscw emulator. I tried by copying the .pyd files to winscw\c\sys\bin and copying key_modifiers file to resource folder.
But I get an error as no module found when I import keypress. I tried it on the phone also but I got the same error.
Any help...

br,
lakhsy
Reply With Quote

#9 Old Re: Using pyd lib in s603rd - 2006-10-11, 14:43

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
Hi lakhsy,

So if you have compiled in the 3rd edition SDK you probably typed :
your_project_folder\abld build winscw udeb

Let say that you named your dll _keypress.pyd. Then you copied it in winscw\c\sys\bin which is correct.

Now in ressource folder you'll create a keypress.py file and you put inside:
Code:
import e32

if e32.s60_version_info>=(3,0):
    import imp
    _keypress = imp.load_dynamic('_keypress', 'c:\\sys\\bin\\_keypress.pyd')
    
else:
    import _keypress

del e32, imp #remove unnecessary names from namespace
from _keypress import *
del _keypress
This will load the dll as it should.

After from your python script you load the module like before:
Code:
import keypress
Try that out and let use know that we make a .sisx for everbody

LFD
Reply With Quote

#10 Old Re: Using pyd lib in s603rd - 2006-10-12, 14:18

Join Date: Oct 2006
Posts: 6
lakhsy
Offline
Registered User
Hi,

Thank you,
I followed the steps which you have explained below. Installtion of the sis package on the phone was ok. But when I tried to load the dll (import keypress) I got an error as
"SymbianError [Error: -46] KErrPermissionDenied."
Then I compiled the source code of the python for S60 for 3rd edition. I have created Python_For_symbianos.sis, Python_for_s60.sis package using my keys and certicate. I was able to import keypress when I type it for the second time in the console. when I try to load it for the first time I am getting an error as

"SystemError _PyImport_ Fix up extension: Module keypress not loaded"

Has anyone tried this or found such type of error.
Any help please...

Thank You,
Br,
Lakhsy
Reply With Quote

#11 Old Re: Using pyd lib in s603rd - 2006-10-12, 21:30

Join Date: Dec 2004
Posts: 646
jplauril's Avatar
jplauril
Offline
Forum Nokia Expert
Have you changed the internal module name in the keypress module source?

The 2nd ed source says:

Code:
    m = Py_InitModule("KeyPress", (PyMethodDef*)keypress_methods);
The module name passed as the first argument to Py_InitModule should match the .pyd filename. If you change the pyd name to _keypress.pyd, you need to change that Py_InitModule first argument to "_keypress".
Reply With Quote

#12 Old Re: Using pyd lib in s603rd - 2006-10-13, 09:43

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
True! I forgot to mention it

Sorry...
Reply With Quote

#13 Old Re: Using pyd lib in s603rd - 2006-10-13, 10:21

Join Date: Oct 2006
Posts: 6
lakhsy
Offline
Registered User
Hi,

Thank You, Finally I got it working. I will place the sis file soon when its in good shape.
I have a question. I would like to know if its possible to capture a screenshot automatically when the screen changes? If yes can anyone please briefly explain me what events I need to use to make it happen. It would really be a great help.

br,
Lakhsy
Reply With Quote

#14 Old Re: Using pyd lib in s603rd - 2006-10-17, 09:46

Join Date: Oct 2006
Posts: 6
lakhsy
Offline
Registered User
Hi,

Sorry for not attaching the sis file becuase Iam still struggling with it to make it working. Now Iam able to import the keypress dll but when I try to access the method as keypress.sumulate_key. It gives me an error as

Attribute Error: Module object has no attribute simulate_key.

Can anyone help me to solve this problem.

Thank You,
br,
Lakhsy
Reply With Quote

#15 Old Re: Using pyd lib in s603rd - 2006-10-17, 10:13

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
Hi lakhsy,

Please post your source that someone can check it.

LFD
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
status pane in E61 screen (320x240 ) s603rd francobellu General Symbian C++ 2 2008-07-10 13:48
Help! I get failed to link my LIB project to GCCE urel chunhsiao Symbian Tools & SDKs 3 2006-09-30 12:10
S60 3rd ed: Creating LIB file for target installation jrantam General Symbian C++ 10 2006-02-13 12:49
VC++ - Perl lib version conflict relliott98 Symbian Tools & SDKs 2 2005-06-28 11:15
Shared lib and threads leoang General Symbian C++ 1 2005-03-23 20:59

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia