#!/home/ajv/work/venv312/bin/python

# cPy - updating table data from sqlite database test.db @ 10 sec
# provided by Anthony Vogelaar, Perth Scotland
# rev 0.10  2024-08-07 initial release

import  os;     os.system('clear')
import  time
import  sqlite3

def main():
    with sqlite3.connect('test.db') as conn:
        n    = 0
        cur  = conn.cursor()
        while True:
            n += 1
            cur.execute('UPDATE data SET avalue = avalue + 100')
            time.sleep(5)
            conn.commit()
            print(n, end='\r')
            time.sleep(5)

main()

# ================================ End ==================================
