You Are Here:

Community: Developer Discussion Boards

#1 Old Where to put a module so I can import it? [using n958gb] - 2008-07-02, 18:05

Join Date: Jun 2008
Posts: 12
Zamoth_bg
Offline
Registered User
Sorry for yet another post but the nokia forum search is not good.

It is a very simple question. I have created a module and I want to import it into my main one? Where should I put it? When I put it in the Python directory it does not find it I am sure i have written it right (exactlly like the name of the file with the module)

Thank you
Reply With Quote

#2 Old Re: Where to put a module so I can import it? [using n958gb] - 2008-07-02, 18:18

Join Date: Mar 2007
Posts: 153
novis
Offline
Regular Contributor
Hello Zamoth_bg,
I'd place it on "e:\\python\\lib" for development and later in your final application on c:\\python\\lib

To make shure that your script'll always find your modules put the following at the very beginning of your script:
Code:
import sys, os, os.path
for path in ('c:\\python\\lib','e:\\python\\lib'): #path to your modules
    if os.path.exists(path):
        sys.path.append(path)
novis
Reply With Quote

#3 Old Re: Where to put a module so I can import it? [using n958gb] - 2008-07-02, 19:01

Join Date: Jun 2008
Posts: 12
Zamoth_bg
Offline
Registered User
Thank you very much!
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
Error import module akus Python 0 2007-10-21 20:47
problem on running my application rsf Python 7 2007-10-21 16:56
Carbide.j 1.5 and Netbeans 5.5 beta 2 ovjo12 Mobile Java Tools & SDKs 5 2007-06-11 06:43
how put FullCanvas.class into the project, and use without import from api?? fredrischter Mobile Java General 1 2007-05-22 11:25
GoogleIt deepika.mangla General Symbian C++ 4 2007-01-08 02:07

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