Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Problem openning files

Iker
2006-09-25
2013-03-15
  • Iker
    Iker
    2006-09-25

    Hi!

    I have a problem. I can´t open file with relative paths (with absolute path works, but I need it be relative).

    My Project structure is that:

    AzureusPlugin
    |_src
       |_AzureusServices(folder)
       |_temp(folder)
       |   |_peticionAzureus2.xml(file I want to open)
       |
       |_main.py
       |_tratarPeticiones.py

    I try to open the file in module tratarPeticiones.py in this way:

    src = './temp/%s' %self.nomPet
    petDoc = xml.dom.minidom.parse(src)

    I think the relative path is correct, but when I try to run the program, it throw me an IOError.

    The PYTHONPATH it's set in this way:

    AzureusPlugin/src

    What do I do wrong?

    (excuse me for my bad english)

     
    • Fabio Zadrozny
      Fabio Zadrozny
      2006-09-25

      Well, actually, I don't think this has anything to do with pydev...

      I think that your current working dir is not suitable for that (so, you have to specify your working dir -- in pydev, the working dir is the Base Directory, on the arguments tab, in the run dialog)

      You can check it from python if you do:
      import os
      print os.path.abspath(os.curdir)

      Cheers,

      Fabio

       
    • Iker
      Iker
      2006-09-25

      Problem Solved

      Thanks!!!