import optparse, os, sys pathFile = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.split(pathFile)[0]) from bin.client3 import ABSClient class changeBeam(object): def __init__(self): self.output = "" def execute(self, beam="0"): absObj = ABSClient(ipDestino="10.10.10.97") #absObj = ABSClient(ipDestino="10.10.20.27") self.output = absObj.changeBeam(beam) def getOutput(self): return self.output usage = "::::::::::::\n" if __name__ == '__main__': parser = optparse.OptionParser(usage=usage) parser.add_option("-n", "--beam", dest="pattern", type="string", default="0", help="Number of Pattern") (options, args) = parser.parse_args() beam = options.pattern app = changeBeam() app.execute(beam)