>>> import sys
>>> sys.ps1 = '+++'
+++ import os
+++ for d in ['foo', 'foo/bar', 'foo/bar/baz']:
... os.mkdir(d)
... open(os.path.join(d, '__init__.py'), 'w').write('')
...
+++ open('foo/bar/baz/qux.py', 'w').write('quux="5"')
+++ import foo.bar.baz.qux.quux
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named quux
+++ from foo.bar.baz.qux import quux
+++ quux
'5'
+++ foo.bar.baz.qux
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'foo' is not defined
+++ from foo.bar import baz
+++ baz.qux.quux
'5'
+++ foo.bar.baz.qux.quux
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'foo' is not defined
+++ import foo
+++ foo.bar.baz.qux.quux
'5'