title: Passing Variable Via Name (not value) from IPython Terminal to Python Script
body: <p>Python novice here. I'm attempting to pass a tuple of large numpy arrays to a script for processing, so I need to use their variable names to pass them from the IPython terminal. </p>
  
  <p>The capability I'm looking for can be simplified to the following:</p>
  
  <p>Suppose script.py is a script that simply prints the variable passed to it.</p>
  
  <pre><code>&gt;&gt;&gt; var_name = (1,True)
  &gt;&gt;&gt; %run script.py var_name
  (1,True)
  </code></pre>
  
  <p>var_name here is a variable that is known by and created by the IPython terminal. As of yet, I've only succeeded in returning "var_name" or Namespace(data=('var_name',)) in attempts at using sys.argv[1] or argparse.</p>
  
  <p>Latest attempt:</p>
  
  <pre><code>import sys
  
  data = tuple(sys.argv[1])
  
  print data
  </code></pre>
  
  <p>The result:</p>
  
  <pre><code>&gt;&gt;&gt; t = (1, True, 3.5, "hi")
  &gt;&gt;&gt; t
  (1, True, 3.5, "hi")
  &gt;&gt;&gt; %run script.py t
  ('t',)
  </code></pre>
  
  <hr>
  
  <p>In MATLAB, the task of importing is simply accomplished in the first line: </p>
  
  <pre><code>function[] = scriptName(inputVar)
  disp(inputVar)
  </code></pre>
  
  <p>Calling the script from the MATLAB terminal would look something like this:</p>
  
  <pre><code>&gt;&gt; scriptName(700)  
     700
  </code></pre>
  
  <p>inputVar can be an int, double, string, matrix, etc.</p>
  
  <p>Is there an equivalent action in Python? Must I be using sys.argv[1] or argparse incorrectly? I know this is a beginner's question, but in the past 2 hours of searching and reading, I've found no solutions.</p>
  
  <p>Thanks!</p>