#!/usr/bin/env python # import required modules: # note that the path to the module htkmfc must be included in the # PYTHONPATH environment variable. # import os import sys # Class: Toaster # # This class facilitates handling a parameter file that controls # how many sweeps are done to generate a det curve. # class Toaster: # define a constructor # def __init__(self): self.height = 0.0; self.width = 0.0 self.length = 0.0 self.models = [] # end of constructor # method: print stuff # # arguments: none # # return: values are printed to stdout # def myprint(self): # print the data # print "height = ", self.height print "width = ", self.width print "length = ", self.length print "models = ", self.models # exit gracefully # return # end of function # method: set stuff # # arguments: none # # return: values are printed to stdout # def myset(self, height, width, length, model): # set the data # self.height = height self.width = width self.length = length # concatenate the model name # self.models.append(model); # exit gracefully # return # end of function # end of class # main program # def main(argv): # declare parameters for the input and output filenames # toaster = Toaster(); toaster1 = Toaster(); toaster.myprint(); # set some values # toaster.myset(27, 28, 29, "Bosch"); toaster1.myset(30, 31, 32, "Bosch"); toaster.myprint(); toaster1.myprint(); print ">> dump an object:", toaster1 # begin gracefully # if __name__ == "__main__": main(sys.argv[0:]) # # end of file