print XML

2012-05-17 Thread Nibin V M
Hello, I have the following code, which will assign XML data to a variable! What is the best method to write the contents of the variable to a file? === doc = minidom.parse(sys.stdin) === Any help will be highly appreciated! Thank you, -- Regards Nibin. http://TechsWare.in -- h

Re: python and xml

2012-05-16 Thread Nibin V M
thank you Stefan. but the XML output is assigned to a variable; how to process the variable with XML contents? On Wed, May 16, 2012 at 7:53 PM, Stefan Behnel wrote: > Nibin V M, 16.05.2012 16:16: > > I am trying to use cPanel XML-API and every API call return data in XML > >

python and xml

2012-05-16 Thread Nibin V M
Hi, I am trying to use cPanel XML-API and every API call return data in XML format. I would like to know how to manipulate the data here. For eg: How can I read the CPU load data from the below output 0.000.000.00 Thank you, -- Regards Nibin. -- http://mail.python.org/mailman/listinfo/

Re: File traversing

2012-04-17 Thread Nibin V M
thanks for a super fast reply Chris :) On Tue, Apr 17, 2012 at 8:06 PM, Chris Angelico wrote: > On Wed, Apr 18, 2012 at 12:31 AM, Nibin V M wrote: > > # python test.py > > File "test.py", line 1 > > with open('/etc/trueuserowners') as res

Re: File traversing

2012-04-17 Thread Nibin V M
;').split(':')[1] for line in res_own_file if ':' in line) print all_res am I missing something? :) On Tue, Apr 17, 2012 at 4:44 PM, Nibin V M wrote: > wow...thanks Karl :) > > On Tue, Apr 17, 2012 at 2:20 AM, Karl Knechtel wrote: > >> >> >&g

Re: File traversing

2012-04-17 Thread Nibin V M
wow...thanks Karl :) On Tue, Apr 17, 2012 at 2:20 AM, Karl Knechtel wrote: > > > On Sun, Apr 15, 2012 at 5:51 AM, Chris Angelico wrote: > >> >> (You may also want to consider using the 'with' statement to guarantee >> a timely closing of the file. Outside the scope of this mail though.) >> >> I

Re: File traversing

2012-04-16 Thread Nibin V M
Thank you Chris :) ..I will check it... On Sun, Apr 15, 2012 at 3:21 PM, Chris Angelico wrote: > On Sun, Apr 15, 2012 at 7:15 PM, Nibin V M wrote: > > res_own_file = open('/bah') > > res_own_list = res_own_file.readline() > > res_tot_list=[] > > w

File traversing

2012-04-15 Thread Nibin V M
Hello, First of all..I am very new to python with no background in development area! :) Ok, here is my problem.I have opened a file and I need to check each line of that file. I have done it with a while loop. res_own_file = open('/bah') res_own_list = res_own_file.readline() res_tot_list=[]