[Gvsig_english] Error when I open a DBF file

Antonio Falciano afalciano at yahoo.it
Wed Apr 4 16:43:59 CEST 2007


Hi Chema,
thanks again for your precious advices!
I'm not a professional developer and so my mistakes are often due
to my way of learning by experience... Although, thanks to this 
collaborative
mailing list and your "tricks", I'm learning a bit more about gvSIG.
I hope that my errors will be helpful for somebody else.

Best regards,
Antonio

Jose Manuel Vivó (Chema) ha scritto:
> 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.
>   




More information about the Gvsig_internacional mailing list