if __name__=="__main__": parse = OptionParser("usage: %prog [options]") parse.add_option("-H",dest="hostname",default="127.0.0.1",type="string",help="The ip of the target") parse.add_option("-P",dest="port",default=2998,type="int",help="The port of the host")
(options,args)=parse.parse_args()
main(options.hostname,options.port)
运行结果:
D:\Python27\a\protostar>debug.py -H 192.168.0.71 1436569335 you correctly sent the data