python - xmltodict throwing errors when used in a .py file -
i want xmltodict in python2.7 , running project have, started copy-pasting example able find
import xmltodict open ('test.xml') fd: doc = xmltodict.parse(fd.read()) print doc
trying run results in error: attributeerror: 'module' object has no attribute 'parse'
same thing when trying convert dict xml using xmltodict.unparse function.
however, works if line line in idle... idea why fails when trying run in .py file, works when use interpreter line line?
just don't name script xmltodict.py
. getting imported instead of installed python environment xmltodict
package.
Comments
Post a Comment