How config gfx with txt file?

in panda3d python code how do I set gfx config?
game_api.txt
here’s code of inside game_api.txt

pandadx9
from panda3d.core import loadPrcFileData
loadPrcFileData("", "load-display pandadx9")

This should be called before a window is opened (also before any DirectStart import).