title: How to pass variables and methods as command line arguments in python
body: <p>I have a scenario. I have to pass the parameter values to the methods in script and methods to execute.</p>
  <p>Example:</p>
  <p>File name app.py</p>
  <pre><code>value1 = sys.argv[1]
  value2 = sys.argv[2]
  def method1():
      print(value1)
  
  def method2():
      print(value2)
  </code></pre>
  <p>Command I am trying to execute: <code>python3 app.py 10 12 method2</code></p>
  <p>In the above the output should be <code>method2()</code> print value is <strong>12</strong></p>