Skip to content

Commit f1934a4

Browse files
committed
Add relative import example
1 parent 57541f3 commit f1934a4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Shows how to enforce and use absolute imports.
2+
# ------------------------------------------------------------------------------
3+
# Example script demonstrating absolute imports.
4+
from __future__ import absolute_import
5+
# Using absolute imports
6+
import asyncio
7+
8+
# Absolute imports
9+
from foo.api.submodule1 import func1
10+
from foo.core.submodule2 import func2
11+
from foo.gui.submodule3 import func3
12+
13+
# Call all functions
14+
func1()
15+
func2()
16+
func3()

0 commit comments

Comments
 (0)