I found the following solution works well.
- Using pycharm or vscode to write and test the script.
- using dbf module.
dbf · PyPI - write and test script to read/write dbf module.
- using python 3 to call the script from ignition, the script does not work if directly calling from ignition.
https://support.inductiveautomation.com/hc/en-us/articles/360056397252-Python-In-Ignition
refer to the other post for a bit more details about the issue if using ignition directly to call the dbf module.