WAS
asked on
add properties
HonorGod,
How are you now, i hope you are feeling better now.
Please provide me a function which will scan the data dictionary and add properties that start with "os-environment." to the beginning of myproperties.properties file
location can be "beginning" or "end"
basically you need to implement a function that inserts a text into a properties file (beginning or end). Once i have that function i will add it to the <addpropeties> class
def addproperties(propertiesli st, propertiesfile, location)
where properties list is something like {property1: value1, property2: value2}
basically a dictionary
How are you now, i hope you are feeling better now.
Please provide me a function which will scan the data dictionary and add properties that start with "os-environment." to the beginning of myproperties.properties file
location can be "beginning" or "end"
basically you need to implement a function that inserts a text into a properties file (beginning or end). Once i have that function i will add it to the <addpropeties> class
def addproperties(propertiesli
where properties list is something like {property1: value1, property2: value2}
basically a dictionary
ASKER
Mish33,
Thanks for helping me.
I am using Jython 2.5.2 interpreter for compiling my python programs,
i get below error
SyntaxError: 'with' will become a reserved keyword in Python 2.6
line 9
and also please explain the functions append and prepend, what are they doing, again what i am looking for is my addproperties function should look into dictionary for attributes (or what ever you call) "os-environment", and add those lines to my propertiesfile.
Let me know if you don't understand my question. It is very important that you understand my question.
Have a nice day.
Thanks for helping me.
I am using Jython 2.5.2 interpreter for compiling my python programs,
i get below error
SyntaxError: 'with' will become a reserved keyword in Python 2.6
line 9
and also please explain the functions append and prepend, what are they doing, again what i am looking for is my addproperties function should look into dictionary for attributes (or what ever you call) "os-environment", and add those lines to my propertiesfile.
Let me know if you don't understand my question. It is very important that you understand my question.
Have a nice day.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The code looks good now.
I was just wondering why didn't you write the prepend function in the same manner as append. instead or creating a temp file and then renaming it.
I was just wondering why didn't you write the prepend function in the same manner as append. instead or creating a temp file and then renaming it.
There is no file open mode for adding to the beginning, so standard technic for that is creating a new file and appending the old file data to it.
ASKER
Thanks a lot Mish33
Open in new window