You Are Here:

Community: Developer Discussion Boards

#1 Old Exclamation Loading modules on 3rd? - 2007-11-08, 19:08

Join Date: Oct 2007
Posts: 6
Location: Aalborg, Denmark
Send a message via MSN to hjortlund Send a message via Skype™ to hjortlund
hjortlund
Offline
Registered User
Hi...

I have just started playing around with PyS60 on Symbian 3rd FP1.
But I'm getting fustrated about problems loading my own Python modules.

I have made a folder named Python on my memorycard and a subfolder names libs ehere I put my modules.
(e:\Python and e:\Python\libs)

I then execute the following 2 lines at the beginning of my script:
Code:
import sys
sys.path.append('e:\Python\libs')
But when I try to load my module like:
import callstatus

I just get the following error:
Code:
Traceback (most recent call last):
  File "<console>", line 1, in ?
  File "c:\resource\site.py", line 112, in platsec_import
    raise ImportError("No module named "+name)
ImportError: No module named callstatus
I really hope some of you guys out there have a solution
Reply With Quote

#2 Old Re: Loading modules on 3rd? - 2007-11-08, 19:53

Join Date: Oct 2007
Posts: 67
nlsp
Offline
Regular Contributor
You should use double backslashes when spelling '\' in a python string: 'e:\\Python\\libs'

You may also want to name your library folder 'lib' instead of 'libs' as it would get added to sys.path automagically in pythons scriptshell default.
Reply With Quote

#3 Old Re: Loading modules on 3rd? - 2007-11-08, 20:20

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
Hi hjortlund and welcome to the forums

The default library folder is lib not libs.

So push your modules in
Code:
E:\\python\\lib
Happy hacking!

LFD


Devices:
Nokia E61 3rd Edition - pys60 1.4.0

Tips and modules:
http://www.lfdm.net/thesis
Reply With Quote

#4 Old Re: Loading modules on 3rd? - 2007-11-08, 21:16

Join Date: Oct 2007
Posts: 6
Location: Aalborg, Denmark
Send a message via MSN to hjortlund Send a message via Skype™ to hjortlund
hjortlund
Offline
Registered User
Now I have renamed my libs folder to lib and tryed sys.path.append('E:\\Python\\lib') and I still get the same error
Reply With Quote

#5 Old Re: Loading modules on 3rd? - 2007-11-09, 00:22

Join Date: Oct 2007
Posts: 67
nlsp
Offline
Regular Contributor
Sorry to see something else must be wrong. I don't have module named 'callstatus', googling around i see an extension exist by that name but not for 3rd, and that it is marked 'deprecated, replaced by sysagent' which turns out to be a link to a .pyd file with no source or installation package.

What functionality do you need from this module?
Reply With Quote

#6 Old Re: Loading modules on 3rd? - 2007-11-09, 07:24

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
Maybe this previous thread could help http://discussion.forum.nokia.com/fo...light=sysagent

But I'm not sure if it will work since it does not say anywhere if the binary is for 2nd or 3rd edition. I'll drop an email to Cyke64.

LFD


Devices:
Nokia E61 3rd Edition - pys60 1.4.0

Tips and modules:
http://www.lfdm.net/thesis
Reply With Quote

#7 Old Re: Loading modules on 3rd? - 2007-11-10, 14:04

Join Date: Oct 2007
Posts: 6
Location: Aalborg, Denmark
Send a message via MSN to hjortlund Send a message via Skype™ to hjortlund
hjortlund
Offline
Registered User
Sorry guys! It seems that my pyd's is not libraries but extensions!

I can understand that extensions have to be installed in "!\sys\bin" via a dev-signed sis file.

So the problem is now, how du I create a SIS file containing my pyd?
Reply With Quote

#8 Old Re: Loading modules on 3rd? - 2007-11-10, 16:47

Join Date: Oct 2007
Posts: 67
nlsp
Offline
Regular Contributor
Quote:
Originally Posted by hjortlund View Post
Sorry guys! It seems that my pyd's is not libraries but extensions!

I can understand that extensions have to be installed in "!\sys\bin" via a dev-signed sis file.

So the problem is now, how du I create a SIS file containing my pyd?
By following the link that lfd kindly pointed you to, yesteeday?

Regards,

Niels
Reply With Quote

#9 Old Re: Loading modules on 3rd? - 2007-11-10, 23:20

Join Date: Oct 2007
Posts: 6
Location: Aalborg, Denmark
Send a message via MSN to hjortlund Send a message via Skype™ to hjortlund
hjortlund
Offline
Registered User
Actually no! But I can see your point
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
Theme Studio 3.1 not creating themes zemm Themes/Carbide.ui 11 2008-10-18 09:41
importing modules (3rd Edition) infomaniac Python 11 2007-12-21 23:00
Script-level modules not allowed in 3rd Ed? kevin_s2f Python 6 2007-07-05 19:46
Compilation series 60 3rd edition asmobease Symbian Tools & SDKs 32 2006-09-13 10:46
Compilation series 60 3rd edition asmobease General Symbian C++ 3 2006-09-10 15:08

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