Reading Java property file in Python

Accessing  a java property file in a python code is an easy task. For this we need to install, a python module called pyjavaproperties. (There are many other ways in which we can do this. I prefer this module)

For installing this, please run the following command :

sudo pip install http://pypi.python.org/packages/source/p/pyjavaproperties/pyjavaproperties-0.6.tar.gz

How to use it 

we have a property file named  config.properties and which is as follows,

config.properties
user=Crunchify
company1=Google
company2=eBay
company3=Yahoo
Now open a python ide and add the following lines
from pyjavaproperties import Properties
p = Properties()
p.load(open('test2.properties'))
p.list()     #will all the properties and its valuesprint                                               print p['user']   #prints Cruchify
Ref :                                                                                                   https://pypi.python.org/pypi/pyjavaproperties                                                           https://www.versioneye.com/python/pyjavaproperties/0.6