I have a web app and a mobile app that connect to my server. In my server I have a module (md.py) that uses another module (config.py) which reads data from a local XML file.
When I send a request to config.py (indirectly) for data from my apps everything works fine. The problem occurs when I call config.py from md.py which are both on the same machine.
This is the hierarchy:
root/
start.py
md/
__init__.py
md.py
server/
__init__.py
config.py
server.py
data/
config.xml
This is md.py
from server import config
class Md:
def get_data(self):
conf = config.Config() # Errno 2 here
This is config.py
import xml.etree.ElementTree as ET
CONF_FILE = "data/config.xml"
class Config:
def __init__(self):
self.file = ET.parse(CONF_FILE)
self.root = self.file.getroot()
And this is how I run these files in start.py
def start():
global server_p
server_p = subprocess.Popen('python ./server/server.py')
md = subprocess.Popen('python ./md/md.py')
What can I do to fix this?