[BangPypers] File operations

mahendra N mahendra0203 at gmail.com
Wed Oct 19 14:04:32 CEST 2011


something like re.findall("resultToExportToCurveDistDialog ' ->' \
#(.*?)),RE.MULTILINE)

the syntax maybe a little wrong :)

2011/10/19 Noufal Ibrahim <noufal at gmail.com>

> Shashidhar Paragonda <shashidhar85 at 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 should
> use a set or a dictionary rather than lists if you want to do membership
> tests.
>
> Also, this
>
>
> all_lines_in_file[line].split('->')[1].split(')')[0].split("'")[1].strip()
>
> is liable to bite you later. I'd suggest you try to simplify it or
> atleast wrap it up in a function with a nice name.
>
>
> [...]
>
>
> --
> ~noufal
> http://nibrahim.net.in
>
> This report is filled with omissions.
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>


More information about the BangPypers mailing list