我想从脚本而不是命令行运行这个函数。例如,函数是:
def main():
parser = argparse.ArgumentParser(description='Caffe prototxt to mxnet model parameter converter.\
Note that only basic functions are implemented. You are welcomed to contribute to this file.')
parser.add_argument('caffe_prototxt', help='The prototxt file in Caffe format')
parser.add_argument('caffe_model', help='The binary model parameter file in Caffe format')
parser.add_argument('save_model_name', help='The name of the output model prefix')
args = parser.parse_args()
...
我怎么能这样运行它?
file.main('file_1.csv', 'file_2.csv', 'name')
为什么有人会编写一个我只能从命令行运行的函数?感觉很不方便。