- Notifications
You must be signed in to change notification settings - Fork0
hackorama/java-props-in-python
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Read the key, element pairs from a java properties file
Follows thejava properties file format and tested against the Java 8 version ofjava.util.Properties
dict getJavaProperties(file)
- Args:
- file: a valid file object (as returned by
open(filename))
- file: a valid file object (as returned by
- Returns:
- The property key and elements as a dict
- Raises:
IOError: if file operation fails with I/O related reason- Corresponds to java
IOExceptioninProperties.load()
- Corresponds to java
UnicodeDecodeError: if the property file has malformed\uxxxxencoding,- Corresponds to java
IllegalArgumentExceptioninProperties.load()
- Corresponds to java
AttributeError: if invalid object was provided for file object- Corresponds to java
NullPointerException
- Corresponds to java
import jpropsprops = jprops.getJavaProperties(open("demo.properties"))print props['greeting']$ cat demo.propertiesgreeting = hello world$ python demo.pyhello worldAbout
Read a java properties file in python
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published