title: I want to read from Properties file and put that value in a string based on a key from file
body: <p>I am new learning python and I have to deal with the properties file in that file the value will be present in key value pair and some how I think managed to readFile but not able to store or print the value based on a key.</p>
  
  <p>I have tried with the jproperties libraries installed through pip.I have read the values in the object but unable to fetch the records from it.
  Have gone through <a href="https://pypi.org/project/jproperties/#parsing-a-property-file" rel="nofollow noreferrer">https://pypi.org/project/jproperties/</a>#parsing-a-property-file website for reference</p>
  
  <pre><code>from jproperties import Properties
  
  class PropertiesReader:
      p = Properties()
      with open("foobar.properties", "rt") as f:
          p.load(f, "utf-8")
  
      s = p.__getitem__("name","value")
      z = p.__getattribute__("email","mail")
      print(s)
      print(z)
  </code></pre>
  
  <p>and the properties file</p>
  
  <pre><code>foobar.properties
      name = Harsh
      email = abc.xyz
  </code></pre>
  
  <p>and the output is </p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/harshk/PycharmProjects/demoPythonPOC/scratch.py", line 4, in &lt;module&gt;
      class PropertiesReader:
    File "/home/harshk/PycharmProjects/demoPythonPOC/scratch.py", line 7, in PropertiesReader
      p.load(f, "utf-8")
    File "/usr/local/lib/python3.7/site-packages/jproperties.py", line 804, in load
      self._parse()
    File "/usr/local/lib/python3.7/site-packages/jproperties.py", line 731, in _parse
      while self._parse_logical_line():
    File "/usr/local/lib/python3.7/site-packages/jproperties.py", line 686, in _parse_logical_line
      self._skip_whitespace()
    File "/usr/local/lib/python3.7/site-packages/jproperties.py", line 438, in _skip_whitespace
      c = self._peek()
    File "/usr/local/lib/python3.7/site-packages/jproperties.py", line 378, in _peek
      c = self._source_file.read(1)
    File "/usr/local/lib/python3.7/codecs.py", line 500, in read
      data = self.bytebuffer + newdata
  TypeError: can't concat str to bytes
  
  Process finished with exit code 1
  </code></pre>
  
  <p>I want to print like </p>
  
  <pre><code>Harsh
  abc.xyz
  </code></pre>