title: How to read the config file as an input when running the python code from command line
body: <p>I have multiple test classes and a basetest class in python.
  test classes inherits from basetest class.</p>
  
  <p>I want to run the test class from command line and it needs some input parameters, these input parameters should be stored in a config file. This config file can be provided as an input from the command line.</p>
  
  <p>How can I achieve this to provide it from command line and then parse the config file. I need parsing to happen in the basetest class because this will be used for all the test classes.</p>
  
  <p>Test Class: You can ignore the content if they don't make much sense as it is just a sample class</p>
  
  <pre><code>from selenium import webdriver
  import unittest
  
  class TestCase():
  
      def setUp(self):
          super().setUp()
  
      def test(self):
          baseUrl = "https://www.google.com"
          driver = webdriver.Firefox()
          driver.get(baseUrl)
          elementByXpath = driver.find_element_by_xpath("//input[@id='name']")
  
          if elementByXpath is not None:
              print("We found an element by XPATH")
  
  if __name__ == '__main__':
      unittest.main(verbosity=2)
      result = unittest.TestResult()
  </code></pre>
  
  <p>BaseTestCase:</p>
  
  <pre><code>class BaseTestCase():
  
      def __init__(self):
          pass
  
      def setUp(self):
          # In the setup() or __init__(), config file should be parsed
          self.login.login("admin", "admin")
  
      def tearDown(self):
          self.log.info("Driver quit, session closed")
  </code></pre>
  
  <p>The file that will be run from the command line will be the test class.
  Something like this:
  python testcase.py --configfile</p>
  
  <p>I am pretty new to python, any help in this is highly appreciated.</p>
  
  <p>I used to work with Java and TestNG, where it's really easy. We can provide any configurations in the TestNG xml file itself.</p>
  
  <p>I am using unittest from python, any suggestion on which framework can be better other than unittest will also be great.</p>
  
  <p>This is for a GUI Test Framework and I need to run tests on different browsers and platform.</p>