Is there an open-source software program to convert dwg to dxf??
I'm not sure I've seen one. LibreDWG was an open source library, but they seem to have been beset with issues and I don't think the project actually went anywhere (anyone know?). Most everyone writing programs that need to use DWG seems to use Teigha which has various membership levels depending on what you want to do with the code.
Since you like python, you might want to give this one a try... http://yorik.uncreated.net/scripts/dxfconvert.py
It is a Linux DWG to DXF converter and requires you to have wine installed and the veryDWG utility.
FWIW...the geoprocessing tool ExportToCAD will create a DXF file. And the input could be the feature classes within a DWG.
Retrieving data ...