Here is another example, showing how to convert a whole folder of VFBs into UFOs:

importosfromsubprocessimportPopen# path to vfb2ufo on your machineufo2vfbLocation="/usr/local/bin/vfb2ufo"# path to folder with input VFBsvfbsFolder=u"/myVFBsFolder"# path to folder for output UFOsufosFolder=u"/myUFOsFolder"# collect all VFBs in VFBs foldervfbs=[fforfinos.listdir(vfbsFolder)ifos.path.splitext(f)[-1]=='.vfb']# batch convert VFBs to UFOforvfbinvfbs:# make file pathsvfbPath=os.path.join(vfbsFolder,vfb)ufoPath=os.path.join(ufosFolder,vfb.replace('.vfb','.ufo'))# call the vfb2ufo programp=Popen([ufo2vfbLocation,vfbPath,ufoPath])# "-64", etcp.wait()# add a note to the converted UFOf=OpenFont(ufoPath,showInterface=False)f.info.note='converted from vfb with vfb2ufo'f.close(save=True)