SHARE
TWEET

Untitled

a guest Jun 25th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. """
  2. from __future__ import absolute_import
  3. from __future__ import division
  4. from __future__ import print_function
  5. """
  6.  
  7.  
  8. """
  9. 1.from __future__ import absolute_import
  10. for namespace control, pkg with name confilction should import from project
  11.  
  12. pkg/
  13. pkg/__init__.py
  14. pkg/main.py
  15. pkg/string.py
  16.  
  17. import string来引入系统的标准string.py, 而用from pkg import string
  18. """
  19.  
  20. """
  21. >>> 3/4
  22. 0
  23. >>> from __future__ import division
  24. >>> 3/4
  25. 0.75
  26. """
  27.  
  28. """
  29. from __future__ import print_function
  30. 在开头加上这句之后,即使在python2.X,使用print就得像python3.X那样加括号使用。
  31. """
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top