I have a problem with using different files in different directories, this is the directory tree of my project:
DeatHash
├── deathash
│ ├── deathash.py
│ ├── dictionaries
│ │ ├── dictionary_test.txt
│ │ └── dictionary.txt
│ ├── files
│ │ ├── archive_test.txt
│ │ ├── cesar.txt
│ │ └── vigenere.txt
│ ├── __init__.py
│ └── __pycache__
│ └── __init__.cpython-36.pyc
├── doc
├── __init__.py
├── LICENSE
└── test
└── test_deathash.py
I need to access the main module deathash.py , path:
DeatHash / deathash / deathash.py
from the test_deathash.py module, path:
DeatHash / test / test_deathash.py
I have already tried to put init.py in the directories (obs: put it with _ (underline) before and after 'init', with .py at the end), also tried using test_deathash.py >, the code
from deathash.deathash import *
Another solution I found is to add to the path the directory that contains the function I'm going to use, but apparently this solution would be ineffective if the project is taken to another directory, which may happen, so if you know of another solution to the problem please help me.