Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. tester
  2. ├── __init__.py
  3. ├── first_level.py
  4. └── sub
  5. ├── __init__.py
  6. └── second_level.py
  7.  
  8. # first_level.py
  9. print "This is the first level of the package"
  10.  
  11. # sub/second_level.py
  12. import ..first_level
  13. print "This is the second level"
  14.  
  15. Python 2.7.3 (default, Aug 1 2012, 14:42:42)
  16. [GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.57))] on darwin
  17. Type "help", "copyright", "credits" or "license" for more information.
  18. Welcome!
  19. >>> import tester
  20. >>> import tester.sub.second_level
  21. Traceback (most recent call last):
  22. File "<stdin>", line 1, in <module>
  23. File "tester/sub/second_level.py", line 1
  24. import ..first_level
  25. ^
  26. SyntaxError: invalid syntax
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement