×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    1

    S60 3rd Edition SDK for Symbian OS

    Hi there,

    I've been searching for a solution to this problem all over the internet. And unless I'm asking the wrong questions I'm not getting the right answers. It seems silly really...

    I've written two python scripts in two modules: one module is DrawIt.py and the calling module is CallIt.py. In the CallIt.py I try to import the DrawIt.py. I get a "ImportError: No module named DrawIt".

    I look in the python installs directory on the emulator, and there they both are. Scratching my head, I try to import ball.py, which comes with the S60 emulator and I can't import that into CallIt either. What's going on?

    Mind you, I'm very new to python and so there might be something I'm missing. When I run python files in Windows they search certain directories including the residing directory for imported modules. Is there something I'm not doing? Do I need to insert these files into a specific directory (and how do i do this with the emulator)?

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: S60 3rd Edition SDK for Symbian OS

    Hi,

    You have to tell Python where to look for your modules:
    Code:
    import sys
    
    #Let's assume DrawIt.py is in C:\Data
    sys.path.append("C:\\Data")
    
    #Now you can import it
    import DrawIt
    You can also create a directory called Lib, put it in the Python folder and put your modules in it, but I recommend the sys.path.append method from above.

Similar Threads

  1. Icons in s60
    By drizzt6 in forum Mobile Java General
    Replies: 5
    Last Post: 2009-03-06, 09:32
  2. OpenGL ES on S60 3rd Edition SDK Emulator
    By specjones in forum Symbian Tools & SDKs
    Replies: 7
    Last Post: 2008-09-30, 10:22
  3. S60 3rd Edition SDK maintenance release Java SDK
    By andresnokia in forum Mobile Java Tools & SDKs
    Replies: 7
    Last Post: 2008-06-23, 19:07
  4. Replies: 1
    Last Post: 2008-05-01, 08:08
  5. S60 3RD EDITION SDK FOR SYMBIAN OS install problems on a raid system
    By rolfstenholm in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2007-02-22, 15:25

Posting Permissions

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