1
A
回答
4
對於Python和XML我經常使用xml.etree
(見它的documentation)。 xml.etree
的好處在於它包含在Python標準庫中。我已經聽說lxml的好消息,它公開了一個etree
兼容的API。
+1
我只是想提醒一下'lxml'是SUPERB和fast,它唯一的缺點是它是第三方庫。 – jathanism 2010-03-30 23:53:46
3
lxml是非常快的。大數據是其最佳選擇。
編輯:但「請注意,lxml本身不提供任何線程安全性(主要是出於性能原因),所以當您同時使用API的某些部分時必須小心。」
1
對於非常小和簡單的事情,xml.dom.minidom
是最簡單的路線。如果你正在尋找一些可以處理大量文件而內存使用量很少的文件,那麼你就需要使用xml.sax解析器。
相關問題
- 1. python os.path.exists not working
- 2. Python Logger not working
- 3. python people api quit working
- 4. python import not working eclipse
- 5. python 3 import not working
- 6. if statement not working,python
- 7. Python。after command not working
- 8. Python 2.7__unicode __(self)not working
- 9. GAE Python Deferred.defer set'task_retry_limit'not working
- 10. Python Microframework Bottle not working
- 11. getElementsByTagName not working javascript,XML,google maps
- 12. python subprocess.call with cwd not working
- 13. python spur reboot command not working
- 14. python crawler extract url not working
- 15. (n)curses pad in python not working
- 16. Vim UltiSnips for python not working
- 17. Python - TWAIN for windows not working
- 18. Python Flask Submit Button Not Working
- 19. python if ... elif always not working
- 20. python pandas index is_unique not working
- 21. python import with __init__.py not working for unknown reasons
- 22. Python字典評論Out a Line not Working
- 23. Listview listselector not working
- 24. import libtorrent not working
- 25. tf.train.shuffle_batch not working for
- 26. import matplotlib.pyplot not working
- 27. Python:pygame.key.get_pressed not working
- 28. Websphere - Transformer.setParameter not working
- 29. RadioButton select not working
- 30. JavaScript getElementById not Working
查看http://stackoverflow.com/questions/2430423 – 2010-03-31 07:58:35