I'm trying to create a virtual XML file, copy some content to it, then access throw parsing, it may be simple, but every path that I'm trying to use ( like 'mem://mem_test.xml' or '{}'.format(mem _file) ) are not working... What path should I use to access a file in the Virtual Memory?
Code:
import fs import xml.etree.ElementTree as Et mem_fs = fs.open_fs('mem://') os_fs = fs.open_fs(".") mem_file = mem_fs.open('mem_test.xml', 'rw') fs.copy.copy_file(os_fs, 'test.xml', mem_fs, 'mem_test.xml') tree = Et.parse('[string with path to mem_test]') root = tree.getroot()
Comment