Issue with Read/Write DBF datafile using dbf module

I am trying to use dbf module for read and write of the DBF database file.

I got the needed functions prepared and tested in VSCode, but when testing them in Ignition Script console, I can read but cannot write value to the db.

The following script has been tested in VSCode.
When testing it in Ignition, the table can be created but no values are added to the table.
before running the script.

  1. copy dbf and aenum module to ignition module folder.
    C:\Program Files\Inductive Automation\Ignition\user-lib\pylib
## code to work with dbf module  aenum-2.1.2 dbf-0.97.11

import dbf

table = dbf.Table('C:\\Users\\xxxx\\Documents\\DBF\\newRecipe.DBF', 'name C(30); age N(3,0); birth D')

print('db definition created with field names:', table.field_names)

table.open(mode=dbf.READ_WRITE)
for datum in (('John Doe', 31, dbf.Date(1979, 9,13)),
              ('Ethan Furman', 102, dbf.Date(1909, 4, 1)),
              ('Jane Smith', 57, dbf.Date(1954, 7, 2)),
              ('John Adams', 44, dbf.Date(1967, 1, 9)),):
    table.append(datum)

print ('records added:')
for record in table:
    print (record)
    print ('-----')

table.close()

table.open(mode=dbf.READ_WRITE)

table.add_fields('telephone C(10)')

telephones = {'John Doe': '1234', 
              'Ethan Furman': '2345', 
              'Jane Smith': '3456', 
              'John Adams': '4567'}
for record in table:
    with record as r:
        r.telephone = telephones[r.name.strip()]

print ('updated records')
for record in table:
    print (record)
    print ('-----')

Maybe issue is at the following new data list, but I cannot figure out why it behaves different in ignition.

for datum in (('John Doe', 31, dbf.Date(1979, 9,13)),
              ('Ethan Furman', 102, dbf.Date(1909, 4, 1)),
              ('Jane Smith', 57, dbf.Date(1954, 7, 2)),
              ('John Adams', 44, dbf.Date(1967, 1, 9)),):

Appreciate if anyone can help with troubleshooting.

The script can create a dbf file.
It can also add the headers.
But the data cannot be inserted.

 table.append(datum)

The above script is not doing the work.

Also when testing in script console, I found the color difference.
The table.open is light yellow color but the table.append is black color.
What is the difference?
image

Spent 2 days troubleshooting the issue and went down to the module details.

I found the table write function is not working under ignition, but working using python 3.x.

Not sure whether it's the issue with Jython2.7.

Anyway, instead of troubleshooting it further, I went alternative way, to call the external python 3 to run the script instead.

Issue resolved.

Here's the link for calling python3 from ignition.