steelywing / dbfpy Goto Github PK
View Code? Open in Web Editor NEWdbfpy (Python 3 port), base on http://dbfpy.sourceforge.net/
dbfpy (Python 3 port), base on http://dbfpy.sourceforge.net/
When I try to import dbf from bdfpy I get the following errors:
print repr(_dbf) is incorrect format.
When I edit line 303 in dbf.py to update to new syntax I get the following errors:
"File "C:/ProgramData/Anaconda3/Lib/site-packages/dbfpy/dbf.py", line 67, in
import header"
Hi Steelwing,
i feel confused with this part of code
in file dbfpy/header.py, line 160
if pos != field.start:
raise ValueError(
'dbf fields definition is corrupt, '
'fields start does not match.'
)
using a dbase file, it returns another number, so i reviewed your dbf files included in your test folder, i saw the dbf is of Visual Foxpro
right?.
I tried my own test with a dbase file, and the field.start is set with 1271005187, so in the if statement it return me a raise statement, if commented the statement does not retrieve the values of the fields because i guess the position is important to retrieve the right value, for that reason only commented the raise statement and i set the field.start with the pos variable and it works.
>>> string=b'NORMAL\x00\x00\x00\x00\x00N\x03\x00\xc2K\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
>>> struct.unpack('< 11s c I 3B I B', string[:24])
(b'NORMAL\x00\x00\x00\x00\x00', b'N', 1271005187, 4, 0, 0, 256, 0)
Well the way to solve my problem is it:
if pos != field.start:
field.start = pos
"""
raise ValueError(
'dbf fields definition is corrupt, '
'fields start does not match.'
)
"""
i tested with the table.dbf and it works, so maybe you can include this change, to make compatible with dbf from dbase III and Visual Foxpro
because the variable pos
did set fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.