-1

I get always the following message :

is_deleted() is not defined

This is my python program. What am i doing wrong?

import dbf

tableDirsync = dbf.Table("o:/python/dirsync.dbf")
tableDirsync.open()

for dirsync in tableDirsync:
    if is_deleted(dirsync):
        continue
    else:  
        print(dirsync.diri1, dirsync.diro1)

tableDirsync.close()
mainloop()
Demon
  • 826
  • 7
  • 22
  • 1
    your code is referring to a function called `is_deleted` and it doesn't exist! you need to figure out where this function has gone. failing that you need to figure out what it did and write your own version – Sam Mason Oct 23 '18 at 16:31

1 Answers1

0

From the documentation of the phyton dbf package (see enter link description here:)

Check if a record has been marked as deleted:
        record = table[1] # for example
        if record.has_been_deleted:
            print "table.pack() will physically remove this record! (and all other deleted records)"

so in your case:

import dbf

tableDirsync = dbf.Table("o:/python/dirsync.dbf")
tableDirsync.open()

for dirsync in tableDirsync:
    if dirsync.has_been_deleted:
        continue
    else:  
        print(dirsync.diri1, dirsync.diro1)

tableDirsync.close()
mainloop()
Torsten Weggen
  • 141
  • 1
  • 6