SIMPLE QUESTION
Calvelo Daniel
dcalvelo at pharion.univ-lille2.fr
Tue Jul 25 15:06:57 EDT 2000
sergio <smoriano at sicon.net> wrote:
: Hi again , i try to explain it better this time.
: From a dll of a pdf converter , i make a py file. And i want to use
: the next function in order to initializate a new printer driver:
: def DriverInit(self, PrinterName=defaultNamedNotOptArg):
: return self._ApplyTypes_(0x1b, 1, (3, 0), ((8, 0),), 'DriverInit',
: None, PrinterName),
: included in the class:
: class ICDIntf(DispatchBaseClass):
: When i try to call it i get the error
: File "<interactive input>", line 0, in ?
: TypeError: unbound method must be called with class instance 1st
: argument.
: I suppose its refering to the argument 'self' so, how can i get the
: class instance to pass it to the function.
Without more info, one can only suppose that your call should have been
along the lines of:
sthg = ICDIntf() # Make a class instance
sthg.DriverInit() # Call the method on the instance
Or:
sthg = ICDIntf()
ICDIntf.DriverInit( sthg ) # Call the unbound method with class
# instance first argument
Or:
ICDIntf().DriverInit() # Probably useless
HTH
-- Daniel Calvelo Aros
calvelo at lifl.fr
More information about the Python-list
mailing list