Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. Here's the current folder hierarchy:
  2.  
  3. - run.py
  4. - util/
  5. - __init__.py
  6. - entry.py
  7. - winrate.py
  8.  
  9.  
  10. Let's say winrate.py straight up imports entry:
  11.  
  12. ```winrate.py
  13. import entry
  14. ```
  15.  
  16. and run.py imports util. If run.py wants access to entry and winrate, that means the __init__ needs to be something like:
  17.  
  18. ```__init__.py
  19. from util import entry, winrate
  20. ```
  21.  
  22. If I run winrate.py from inside the util folder, everything's fine. If I try importing it through util into run.py, I need to change the `import entry` line to `from util import entry`, which means I can no longer run it from the util folder.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement