hello Alf,
where did you look for the file "example.dxf"? I found it in /opt/qcad3, because this is where I installed qcad3. (That's called the "working directory" of the application. Unfortunately this is different from the "current directory", the one where I issue the command…)
You will not find it though, if you comment the line that saves the drawing to file

Maybe make the line read "di.exportFile("/home/alf/example.dxf", "DXF 2000");" to have it created in your home directory, if you go by the name "alf" on your system…