I'm using the rdkit Chem library to create an svg file:
Draw.MolToFile(mol, path, size=(400, 400))
It usually works fine when I read it like so:
with open(path) as myfile:
image = myfile.read()
Other times it will return an empty string unless I add a time.sleep(0.1) before reading it, and then it will work.
Any idea why this could be happening?
System Specifications :
rdkit version: 2019.09.3
OS: ubuntu 18.04.5 LTS
file extension: svg