title: Command Line arguments to Robot framework via python file
body: <p><strong>language</strong>: python - 3.7.3
  <strong>Robot framework</strong> - 3.1.1
  <strong>proficiency</strong>: Novice</p>
  
  <p>I want to pass arguments to python file variables from command prompt and then want to print the same from robot file by adding python file as variable.</p>
  
  <pre><code>cmd (Variables) --&gt; python file --&gt; robot (print those variables) 
  </code></pre>
  
  <p>But apparently none of the try has yielded expected results. Any guidance will be highly appreciated.</p>
  
  <p><strong>Note:</strong> Both Robot and Python files are under same directory in pycharm IDE.</p>
  
  <p><strong>Command Line:-</strong></p>
  
  <pre><code>1st try: robot -d Report -V test.py Test_sample.robot|py test.py test@test.com test@123 QA1
  
  2nd try: robot -d Report Test_sample.robot|py test.py test@test.com test@123 QA1
  
  3rd try: robot -d Report --Variablefile py test.py Test_sample.robot|py test.py test@test.com test@123 QA1
  
  4th try: robot -d Report -V | py test.py test@test.com test@123 QA1| Test_sample.robot
  </code></pre>
  
  <p><strong>Python:-</strong></p>
  
  <pre><code>import sys
  
  username = str(sys.argv[1])
  password = str(sys.argv[2])
  environment = str(sys.argv[3])
  </code></pre>
  
  <p><strong>Robot:-</strong></p>
  
  <pre><code>*** Settings ***
  Library     SeleniumLibrary
  Library     Collections
  Variables  test.py
  
  *** Test Cases ***
  Pass variables from Python File
  
          log to console  The usr is: "${username}"
          log to console  The pwd is: "${password}"
          log to console  The env is: "${environment}"
  </code></pre>
  
  <p><strong>Expected:</strong> </p>
  
  <p>The usr is: test@test.com
  The pwd is: test@123
  The env is: QA1</p>
  
  <p><strong>Actual:</strong></p>
  
  <pre><code>[ ERROR ] Unexpected error: OSError: [Errno 22] Invalid argument
  Traceback (most recent call last):
    File "&lt;&lt;Dir path&gt;&gt;\python\python37-32\lib\site-packages\robot\utils\application.py", line 83, in _execute
      rc = self.main(arguments, **options)
    File "&lt;&lt;Dir path&gt;&gt;\python\python37-32\lib\site-packages\robot\run.py", line 439, in main
      result = suite.run(settings)
    File "&lt;&lt;Dir path&gt;&gt;\python\python37-32\lib\site-packages\robot\running\model.py", line 222, in run
      self.visit(runner)
    File "&lt;&lt;Dir path&gt;&gt;\python\python37-32\lib\site-packages\robot\model\testsuite.py", line 168, in visit
      visitor.visit_suite(self)
    File "&lt;&lt;Dir path&gt;&gt;\python\python37-32\lib\site-packages\robot\model\visitor.py", line 84, in visit_suite
      if self.start_suite(suite) is not False:
    File "&lt;&lt;Dir path&gt;&gt;\python\python37-32\lib\site-packages\robot\running\runner.py", line 83, in start_suite
      test_count=suite.test_count))
    File "&lt;&lt;Dir path&gt;&gt;\python\python37-32\lib\site-packages\robot\output\output.py", line 51, in start_suite
      LOGGER.start_suite(suite)
    File "&lt;&lt;Dir path&gt;&gt;\python\python37-32\lib\site-packages\robot\output\logger.py", line 200, in start_suite
      logger.start_suite(suite)
    File "&lt;&lt;Dir path&gt;&gt;\python\python37-32\lib\site-packages\robot\output\console\verbose.py", line 35, in start_suite
      self._writer.suite_separator()
    File "&lt;&lt;Dir path&gt;&gt;\python\python37-32\lib\site-packages\robot\output\console\verbose.py", line 104, in suite_separator
      self._fill('=')
    File "&lt;&lt;Dir path&gt;&gt;\python\python37-32\lib\site-packages\robot\output\console\verbose.py", line 110, in _fill
      self._stdout.write('%s\n' % (char * self._width))
    File "&lt;&lt;Dir path&gt;&gt;\python\python37-32\lib\site-packages\robot\output\console\highlighting.py", line 53, in write
      self.flush()
    File "&lt;&lt;Dir path&gt;&gt;\python\python37-32\lib\site-packages\robot\output\console\highlighting.py", line 66, in flush
      self.stream.flush()
  Exception ignored in: &lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='cp1252'&gt;
  OSError: [Errno 22] Invalid argument
  </code></pre>