Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Import Python files from a c++ project

$
0
0

I have a c++ submodule inside my Python project. The file tree looks like this:

Project    |-src          |-main_dir          |-utils                |-util.py    |-modules          |-cpp_module                |-scripts                      |-py_files                             |-__init__.py                             |-file.py

I need to import the items from file.py into util.py.

I’ve tried doing relative imports, but from ….modules.cpp_module.scripts import py_files doesn’t work. I’d prefer to do this in a non-hacky way and I don’t want to turn the submodule into a whole Python project if I can help it.


Viewing all articles
Browse latest Browse all 23131

Trending Articles