Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User yanhua's Avatar
    Join Date
    Sep 2007
    Posts
    33
    hi all,

    The code below runs perfectly on PC:

    =====================================
    from elementtree.ElementTree import Element
    from elementtree.ElementTree import SubElement
    from elementtree.ElementTree import parse
    from elementtree.ElementTree import ElementTree

    xmlFile = "c:\\database.xml"
    tree = parse(xmlFile)
    =====================================
    However, on the emulator, (i am using sdk s60 2nd 3fp, with elementtree module)

    when i try to run the code above, the console pops out:
    No such file or directory"c:\\database.xml"

    Is there any specific location that I should copy the xml to , so that the console could find it? I have tried to copy the xml file to where all the python scripts are placed, but it still does not work.

  2. #2
    Super Contributor lfd's Avatar
    Join Date
    May 2006
    Location
    Oulu, Finland
    Posts
    622
    Hi yanhua,

    With PyS60 you need to use cElementTree by Simo Salminen.

    You import the module like this:
    Code:
    from cElementTree import ElementTree, XMLTreeBuilder ...
    Try to put your file in E:

    LFD
    Devices:
    Nokia E61 3rd Edition - pys60 1.4.0

    Tips and modules:
    http://www.lfdm.net/thesis

  3. #3
    Registered User yanhua's Avatar
    Join Date
    Sep 2007
    Posts
    33
    What I tried is copy the celementtree.pyd to the emulator subdirectory, and copy elementtree folder to the lib(just as i saw in the older post about cElementtree,'[announce] cElementTree for pys60 *alpha*'). But I cannot import cElementtree

    Is there any more detailed instruction that I can follow?


    Quote Originally Posted by lfd View Post
    Hi yanhua,

    With PyS60 you need to use cElementTree by Simo Salminen.

    You import the module like this:
    Code:
    from cElementTree import ElementTree, XMLTreeBuilder ...
    Try to put your file in E:

    LFD

Similar Threads

  1. File corrupted - with signed sis
    By annehj in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 4
    Last Post: 2007-12-10, 13:44
  2. a question of create sis file
    By hhyyqq in forum Themes/Carbide.ui
    Replies: 0
    Last Post: 2007-04-23, 15:11
  3. How to reformat the file?
    By ryanfunghk in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-03-26, 17:43
  4. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15:31
  5. the question about creating mbm file?
    By hyorke in forum Symbian
    Replies: 1
    Last Post: 2003-07-21, 03:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved