0
Hi every SoloLearners~~ Somebody plz Help me!!Ha!
Hi there. this is the first time to use SoloLearn with python I wanted to parse a file named "staff.xml" in code playground. my code is -------------------------------------- from xml.dom import minidom doc = minidom.parse("staff.xml") # doc.getElementsByTagName returns NodeList name = doc.getElementsByTagName("name")[0] print(name.firstChild.data) -------------------------------------- but when I run this code, the output is FileNotFoundError: [Errno 2] No such file or directory: 'staff.xml' so, my question is that if I could bring that file 'staff.xml' in code playground?
3 Answers
+ 7
When you do something like this, it tries to fetch the file from local storage which, in this case, is SoloLearn server because script is executed there...
+ 5
you can't do external files on sololearn. try downloading python for your pc, or maybe qpython for android, if you want to edit files and in general do a lot more.
+ 1
First of all you need to upload that XML file somewhere in internet and than paste that link of your XML file in the code playground