title: How can i call a Python function from a script that was meant to run on command line
body: <p>I would like to run this function from a script instead of the command line. For example, the function is:</p>
  
  <pre><code>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()
      ...
  </code></pre>
  
  <p>How can i run it like this?</p>
  
  <pre><code>file.main('file_1.csv', 'file_2.csv', 'name')
  </code></pre>
  
  <p>And why would someone write a function that I can only run from the command line? It feels inconvenient. </p>