title: Passing Strings as Python command-line arguments
body: <p>I’m able to pass ints and chars as Python command-line args, but can’t pass Strings successfully to the following:</p>
  
  <pre><code>if __name__ == '__main__' :
      try :
          print(len(sys.argv))
          arg1 = ast.literal_eval(sys.argv[1])
          arg2 = ast.literal_eval(sys.argv[2])
          print(arg1)
          print(arg2)
      except Exception :
          print('error')
  </code></pre>
  
  <p>The following works:</p>
  
  <pre><code>python test.py 1 2
  </code></pre>
  
  <p>and prints:</p>
  
  <pre><code>3
  1
  2
  </code></pre>
  
  <p>as dos the following:</p>
  
  <p>python test.py ‘1’ ‘2’</p>
  
  <p>which also prints</p>
  
  <pre><code>3
  1
  2
  </code></pre>
  
  <p>However, the following does not work:</p>
  
  <pre><code>python test.py ‘one’ ‘two’
  </code></pre>
  
  <p>It sees the number of args, but throws an Exception trying to grab them:</p>
  
  <pre><code>3
  error
  </code></pre>
  
  <p>Could someone please provide some guidance on how to pass Strings as command-line args?</p>
  
  <p>Thanks.</p>