Guest User

Untitled

a guest
May 25th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. import lxml
  2. full_xml_tree = lxml.etree.parse('myfile.xml')
  3.  
  4. AttributeError: module 'lxml' has no attribute 'etree'
  5.  
  6. import lxml.etree
  7. full_xml_tree = lxml.etree.parse('myfile.xml')
  8.  
  9. import xml.etree.ElementTree as ET
  10. tree = ET.parse('myfile.xml')
  11.  
  12. test_pkg/__init__.py
  13. test_pkg/shown_module.py
  14. test_pkg/hidden_module.py
  15.  
  16. from . import shown_module
  17.  
  18. >>> import test_pkg
  19. >>> test_pkg.shown_module
  20. <module 'test_pkg.shown_module' from '.../test_pkg/shown_module.py'>
  21.  
  22. >>> test_pkg.hidden_module
  23. Traceback (most recent call last):
  24. File "<stdin>", line 1, in <module>
  25. AttributeError: module 'test_pkg' has no attribute 'hidden_module'
  26.  
  27. >>> import test_pkg.hidden_module
  28. >>> test_pkg.hidden_module
  29. <module 'test_pkg.hidden_module' from '.../test_pkg/hidden_module.py'>
Add Comment
Please, Sign In to add comment