×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    17

    importing class as library

    Hi,
    I'd like to split my py file in different files, each containing a class.

    I created a file menu.py with a class called menu in the same dir as the main app file
    then in the main file I wrote
    PHP Code:
    import menu 
    but it gives me an importError

    I also tried
    PHP Code:
    import menu.py 
    or putting menu.py in lib folder but it doesn't work.

    Can you help me?
    I'm using an N95

    thanks

    Giuseppe

  2. #2
    Registered User
    Join Date
    May 2007
    Posts
    25

    Re: importing class as library

    Assuming that you put your mainapp.py into e:/python, you might want to put menu.py into e:/python/lib.

    Cheers,

    Joerg

  3. #3
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,796

    Re: importing class as library

    Or consider appending the path of the folder consisting the library.

    For example,

    Code:
    sys.path.append(path)
    Pankaj Nathani
    www.croozeus.com

Similar Threads

  1. External Linking Error (Undefined Symbol)
    By nile_mail in forum Symbian
    Replies: 2
    Last Post: 2008-08-05, 13:10
  2. Need one HTTP client example
    By vinayakak in forum Symbian Networking & Messaging (Closed)
    Replies: 15
    Last Post: 2008-01-06, 06:44
  3. need information about j2me polish
    By rathikathangaraj in forum Mobile Java General
    Replies: 4
    Last Post: 2007-12-19, 09:01
  4. send array[0] different class
    By gift_te in forum Symbian
    Replies: 0
    Last Post: 2007-03-28, 13:04
  5. 21 errors in j2me , help in soving them
    By abhishek_1211 in forum General Messaging
    Replies: 0
    Last Post: 2006-04-01, 09:04

Posting Permissions

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