我总是收到以下消息:
is_deleted()未定义
这是我的python程序。 我在做什么错了?
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()
答案 0 :(得分:0)
摘自phyton dbf软件包的文档(请参见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)"
所以在您的情况下:
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()