×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    33

    Question about locating a file by pys60

    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
    Join Date
    May 2006
    Location
    Oulu, Finland
    Posts
    622

    Re: Question about locating a file by pys60

    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
    Join Date
    Sep 2007
    Posts
    33

    Re: Question about locating a file by pys60

    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. How to reformat the file?
    By ryanfunghk in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-03-26, 17:43
  3. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15: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
  •  
×