python calling a module that uses argparser : <p>This is probably a silly question, but I have a python script that current takes in a bunch of arguements using argparser and I would like to load this script as a module in another python script, which is fine. But I am not sure how to call the module as no function is defined; can I still call it the same way I do if I was just invoking it from cmd?</p>

<p>Here is the child script:</p>

<pre><code>import argparse as ap
from subprocess import Popen, PIPE

parser = ap.ArgumentParser(
    description='Gathers parameters.')
parser.add_argument('-f', metavar='--file', type=ap.FileType('r'), action='store', dest='file',
                    required=True, help='Path to json parameter file')
parser.add_argument('-t', metavar='--type', type=str, action='store', dest='type',
                    required=True, help='Type of parameter file.')
parser.add_argument('-g', metavar='--group', type=str, action='store', dest='group',
                    required=False, help='Group to apply parameters to')
# Gather the provided arguements as an array.
args = parser.parse_args()

... Do stuff in the script
</code></pre>

<p>and here is the parent script that I want to invoke the child script from; it also uses arg parser and does some other logic</p>

<pre><code>from configuration import parameterscript as paramscript

# Can I do something like this?
paramscript('parameters/test.params.json', test)
</code></pre>

<p>Inside the configuration directory, I also created an <strong>init</strong>.py file that is empty.</p>
