mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 14:50:19 +00:00
Fix varibable name in XML parsing scenario
In the xmltodict example, the xml is loaded in the variable obj but is later referenced as doc. Fixed by renaming obj to doc
This commit is contained in:
@@ -59,7 +59,7 @@ can be loaded into a Python dict like this:
|
||||
import xmltodict
|
||||
|
||||
with open('path/to/file.xml') as fd:
|
||||
obj = xmltodict.parse(fd.read())
|
||||
doc = xmltodict.parse(fd.read())
|
||||
|
||||
and then you can access elements, attributes and values like this:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user