[BangPypers] File operations

2011-10-19 Thread Shashidhar Paragonda
Dear Python hackers, I have a text file and the contents are like : #( #resultToExportToCurveDistDialog ' -' #off) like same structure many lines exists. My requirement is I want to find

Re: [BangPypers] File operations

2011-10-19 Thread Noufal Ibrahim
Shashidhar Paragonda shashidha...@gmail.com writes: Dear Python hackers, I have a text file and the contents are like : #( #resultToExportToCurveDistDialog ' -' #off) like same structure

Re: [BangPypers] File operations

2011-10-19 Thread mahendra N
Have you thought of using regular expressions? You can get all the values at once.. Thanks and Regards, Mahendra Naik 2011/10/19 Shashidhar Paragonda shashidha...@gmail.com Dear Python hackers, I have a text file and the contents are like : #(

Re: [BangPypers] File operations

2011-10-19 Thread Shashidhar Paragonda
Hello Mahendra thanks for replying Sorry I have really not thought of regular expression do you know the solution or method to resolve this On Wed, Oct 19, 2011 at 4:46 PM, mahendra N mahendra0...@gmail.com wrote: Have you thought of using regular expressions? You can get all the values at

Re: [BangPypers] File operations

2011-10-19 Thread Shashidhar Paragonda
Dear Noufal, Thanks for your reply I did in this way is it efficient way to achieve the same requirement all_lines_in_file = open(file.txt, r).readlines() for line in range(0, len(all_lines_in_file)-1): if resultsToPDFFile in all_lines_in_file[line]:

Re: [BangPypers] File operations

2011-10-19 Thread Noufal Ibrahim
Shashidhar Paragonda shashidha...@gmail.com writes: Dear Noufal, Thanks for your reply I did in this way is it efficient way to achieve the same requirement Doesn't seem so to me. You're going over the lines of the file once without and two times within for each of those iterations. You

Re: [BangPypers] File operations

2011-10-19 Thread mahendra N
something like re.findall(resultToExportToCurveDistDialog ' -' \ #(.*?)),RE.MULTILINE) the syntax maybe a little wrong :) 2011/10/19 Noufal Ibrahim nou...@gmail.com Shashidhar Paragonda shashidha...@gmail.com writes: Dear Noufal, Thanks for your reply I did in this way is it

Re: [BangPypers] File operations

2011-10-19 Thread Shashidhar Paragonda
Hello Noufal I have tried your solution but i get invalid syntax for this line *with open() *I am using python 2.3.5 what could be the problem. On Wed, Oct 19, 2011 at 3:52 PM, Noufal Ibrahim nou...@gmail.com wrote: Shashidhar Paragonda shashidha...@gmail.com writes: Dear Python

Re: [BangPypers] File operations

2011-10-19 Thread Noufal Ibrahim
Shashidhar Paragonda shashidha...@gmail.com writes: Hello Noufal I have tried your solution but i get invalid syntax for this line *with open() *I am using python 2.3.5 what could be the problem. You could simply use f = open(file.txt,r) instead. The with statement was added

Re: [BangPypers] File operations

2011-10-19 Thread Shashidhar Paragonda
Our customer wants some addon and our tool at customer place is still running with Python v2.3.5 Zope v2.7.X I dont have option to change now ,ya in near future I am migrating to newer version of python zope. On Wed, Oct 19, 2011 at 6:13 PM, Noufal Ibrahim nou...@gmail.com wrote: Shashidhar

[BangPypers] pyjamas

2011-10-19 Thread Kenneth Gonsalves
hi, I was looking at pyjamas - it seems a little unusual - has anyone used it and has feedback on it? -- regards Kenneth Gonsalves ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers