Hello,

There are specific operating system, path related modules in Python for
handling these scenarios.

You could try looking at os.path module.

On Tue, Nov 6, 2018 at 11:16 PM Asad <asad.hasan2...@gmail.com> wrote:

> Hi all ,
>
>         Can you provide some advice and code for the following problem :
>
> I have a logfile to check for errors :
>
> /a/b/c/d/test/test_2814__2018_10_05_12_12_45/logA.log
>
> f3 = open ( r"/a/b/c/d/test/test_2814__2018_10_05_12_12_45/logA.log", 'r' )
> st1 = f3.readlines ()
>
> from the above log I extract the directory location to determine the
> location of  another log  using the following regular expresssion:
>

Specifically, try exploring "dirname" function of os.path module. That
might come in handy for your situation.

-- 
        Thanks
               -- Sarfraaz Ahmed
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to