title: How to receive input parameters in various python scripts through a common json file
body: <p>I have the following json input parameters file</p>
  <pre><code>#input.json
  {
          &quot;nx&quot;: 401, 
          &quot;ny&quot;: 401,
          &quot;T&quot; : 10,
          &quot;nt&quot; : 20,
          &quot;D&quot; : 0.2,
          &quot;Sgma&quot;: 0.243,
          &quot;M&quot;: 0.0052
  }
  
  </code></pre>
  <p>that is passed onto different <code>python</code> scripts, for eg.</p>
  <pre><code>#test1.py
  import numpy,os
  
  def simple(nx,ny,D,Sgma, M, T,nt):  #parameters as function arguments
      k = Sgma + 0.02
      print(&quot;this is domain size&quot;, ny)
      print(&quot;this is dif time&quot;, T)
      print(&quot;this is K param&quot;, k)
  </code></pre>
  <pre><code>#test2.py
  import numpy,os
  
  def simple_n(nx,ny,D,Sgma,M,T,nt):  #parameters as function arguments
      k = M + 0.02
      print(&quot;this is domain size&quot;, ny)
      print(&quot;this is sim time&quot;, D)
      print(&quot;this is K param&quot;, k)
  </code></pre>
  <p>I execute both the above <code>python</code> scripts through a <code>main.py</code> that passes the input parameters with argparse.</p>
  <p>As you can see, only some, not all of the parameters are required in individual scripts. My question: Is there a way to pass only the required arguments in <code>simple()</code> ?</p>
  <p>For example: <code>def simple(ny,T,k)</code> for <code>test1.py</code> and <code>def simple(ny,D,k)</code> for <code>test2.py</code> rather than <code>def simple(nx,ny,D,Sgma, M,T,nt)</code>.  Since I will be dealing with large sets of parameters as initial config, I would like to know an efficient way to pass the initial parameters in different <code>python</code> codes as function arguments. Thanks</p>