title: Passing argument to a defined function so they accessible to sys.argv in python3
body: <p>I have a program (<code>temp.py</code>) in python3 that reads the temperature at sensors in a solar panel. I also have a program (<code>stepper.py</code>) that I use to control a stepper motor. The program <code>stepper.py</code> uses <code>sys.argv</code> to evaluate arguments and determine how far and how quickly the motor should turn. I now want to call <code>stepper.py</code> from <code>temp.py</code> to combine the functionality of the two programs. However, when I call <code>stepper.py</code> from <code>temp.py</code> the arguments are not passed in a way that <code>sys.argv</code> can use them. I have written a short script to illustrate my problem:</p>
  
  <pre><code>import sys  
  y=5  
  z=2  
  def called(a,b): 
      print(str(sys.argv))  
      print(len(sys.argv[1:]))  
      global p,q  
      p=a*b  
      q=a+b
  
  called(y,z)  
  print(p,q)
  </code></pre>
  
  <p>This script returns the following:</p>
  
  <pre><code>['/home/pi/calling.py']  
  0  
  10 0
  </code></pre>
  
  <p>In other words, although the calculation of the arguments has been completed, <code>sys.argv</code> is saying that no arguments have been passed and merely shows <code>argv[0]</code> which is the program's name. I understand why this occurs but is there any way that I can get <code>sys.argv</code> to "see" the arguments?</p>