VMward / algorithm-visualization

Visualize graph theory with graphQL. Machine learning and algorithms made easy.
MIT License
2 stars 0 forks source link

Python File Structure #2

Open bunilly opened 3 years ago

bunilly commented 3 years ago

Do we have to nest the project in the following way?

py
| - src
      | - algorithms
      | - server
      | - data structures

Can we put server at the same level as src?

benjaminfan commented 3 years ago

In the future we could serve algorithms and datastructures as an import, but since python3.3 implicit relative references aren't allowed so they need to be in the same level.

We could do the hacky/ugly approach but adhering to module level imports seems better to me.

import os, sys
currentdir = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(currentdir)
sys.path.append(parentdir)