Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- from __future__ import absolute_import
- from __future__ import division
- from __future__ import print_function
- """
- """
- 1.from __future__ import absolute_import
- for namespace control, pkg with name confilction should import from project
- pkg/
- pkg/__init__.py
- pkg/main.py
- pkg/string.py
- import string来引入系统的标准string.py, 而用from pkg import string
- """
- """
- >>> 3/4
- 0
- >>> from __future__ import division
- >>> 3/4
- 0.75
- """
- """
- from __future__ import print_function
- 在开头加上这句之后,即使在python2.X,使用print就得像python3.X那样加括号使用。
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement