age = raw_input('How old are you?\n') high = raw_input('How tall are you?\n') weight = raw_input('How much do you weigh?\n') numage = extract_num(age) numhigh = extract_num(high) numweight = extract_num(weight) convage = (numage * 52) convhigh = ( numhigh / 30.48 ) convweight = ( numweight * 2.2 ) return "weeks " + str(convage) + " feet " + str(("%.2f" %convhigh)) + " pounds " + str(convweight) if len(sys.argv) > 2: usage() elif len(sys.argv) == 1: usage() elif sys.argv[1] == 'male': sex = 'male' output = main() write_file(output,sex) elif sys.argv[1] == 'female': sex = 'female' output = main() write_file(output,sex) else: usage()
output = net.metrics.obtain( dataTest, tepr, conf, err ) print print "Test statistics:" print conf print "\n".join(map(string.strip,filter(len,output.values()))) ftr = config.get("Output", "probstrain") fte = config.get("Output", "probstest") if ftr: Data.writeProbs(trpr, ftr) if fte: Data.writeProbs(tepr, fte) model = config.get("Output", "savemodel") if model: net.savemodel(model) ############################################################################## if __name__ == "__main__": try: import psyco psyco.full() except ImportError: pass logging.basicConfig(format="%(message)s") from usage import * config = usage() main(config)