Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tester
- ├── __init__.py
- ├── first_level.py
- └── sub
- ├── __init__.py
- └── second_level.py
- # first_level.py
- print "This is the first level of the package"
- # sub/second_level.py
- import ..first_level
- print "This is the second level"
- Python 2.7.3 (default, Aug 1 2012, 14:42:42)
- [GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.57))] on darwin
- Type "help", "copyright", "credits" or "license" for more information.
- Welcome!
- >>> import tester
- >>> import tester.sub.second_level
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- File "tester/sub/second_level.py", line 1
- import ..first_level
- ^
- SyntaxError: invalid syntax
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement