[Gvsig_english] Error when I open a DBF file

Jose Manuel Vivó (Chema) josemanuel.vivo at iver.es
Wed Apr 4 08:23:39 CEST 2007


Hi, Antonio:

El Martes 03 Abril 2007 16:47, Antonio Falciano escribió:
>  >>> from java.io import File
>  >>> pathToDbf="D:\workspace\myDBF.dbf"
>  >>>
> dbaseFile=gvSIG.classForName("com.iver.cit.gvsig.fmap.drivers.dbf.DbaseFile
>") >>> myDBFFile=File(pathToDbf)

>  >>> dbaseFile.open(myDBFFile)
> TypeError: open(): expected 2 args; got 1

'dbaseFile' is a Class not an Object. First, you have to create a new 
instance:

dbaseFileInstance = dbaseFile()
dbaseFileInstance.open(myDBFFile)

> From javadocs, the method "open" of "DbaseFile" accepts only one argument.
In Python/Jython the first argument that recive an object function is 'self'. 
In a normal call this argument is send automatically by the interpreter but 
you had tried to do it to the Class directly.

Best Regards
Chema.
-- 
=============
Jose Manuel Vivó (Chema)
Equipo de gvSIG

IVER T.I. S.A.
C/ Salamanca, 50-52
46005-Valencia
Tlf.+34963163400
Spain
www.iver.es
www.gvsig.com





More information about the Gvsig_internacional mailing list