1

Similar questions have been asked many times, but I didn't find a solution yet. I have Python Project that is structured as follows (simplified version).
The problem is to import module1 in myscript.py. So far, I've written sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..')) on top of myscript.py, but this is not very elegant and I wonder what's the best structure for my project that can easily import modules from the project to scripts that are located in a separate folder.

project
--project
----module1.py
----module2.py
----__init__.py
--examples
--scripts
---myscript.py
--Readme.md
  • 1
    you can look at this link http://docs.python-guide.org/en/latest/writing/structure/ also there is a PEP that is describing how to organize a project (don't remember wich one exactly) – Whitefret Mar 31 '16 at 13:43
  • What's the purpose of `myscript.py`? For testing the other modules? An example of using them, or? – martineau Mar 31 '16 at 15:30
  • No, the scripts (actually there's at least a dozen) contain measurements, evaluations and other stuff using the modules of the project. –  Mar 31 '16 at 19:49

0 Answers0