0

Example of Files directory:

base-->
      src_c-->
              Example.cpp (imports myPyExample.py)
      src_python-->
              myPyExample.py

and I'd like to import python script using pybind11

What is the way to do it? (found only examples where both are under the same folder)

GM1
  • 380
  • 3
  • 14

1 Answers1

0

This may be overly simple, but you could just use '../src_python/myPyExample.py'

Another solution would be to have some function which returns the absolute path to 'base' then use it to create an absolute path to 'src_python'

like this: path = getBaseDirectory() + "/src_python/myPyExample.py"