1

I have a directory folder:
MainFolder : [ matlab_folder : (file1.mat), python_folder : (file2.py) ]
I'm writing a program in file2.py, which needs the code from file1.mat. How am I supposed to write the path to it? The absolute path won't work as I need this project to work on other computers.
I also use setuptools, setup.py is located in the same directory as MainFolder. I read that pathes must be done differently in case of setuptools.

Kedr
  • 11
  • 2
  • Look into [_`pkgutil`_](https://docs.python.org/3/library/pkgutil.html) or [_`importlib.resources`_](https://docs.python.org/3/library/importlib.html#module-importlib.resources). More details in [this answer](https://stackoverflow.com/a/58941536). And [here](https://sinoroc.gitlab.io/kb/python/package_data.html) some ideas on how to write your `setup.py` and do the packaging with _setuptools_ correctly. – sinoroc Mar 21 '21 at 09:55

0 Answers0