hello,
i need to use module.function passed from command line, by now i use :
if __name__ == '__main__':
args = sys.argv[1:]
if len(args) == 0:
## print help information and exit:
usage()
sys.exit(2)
im = '.'.join(sys.argv[1].split('.')[:-1])
func = sys.argv[1].split('.')[-1:][0]
exec("from %s import %s" % (im, func))
-> and then func()
is there a more correct way to do it ?
thanks,
s13.