Hello folks,

I wanna know how can i extract path of a program whose path i have added to
the PATH variable.

This is what i have done

import os

x=os.getenv("PATH")

print x

>>%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\Program
Files\Microsoft SQL Server\90\Tools\binn\;C:\Program
Files\QuickTime\QTSystem\;C:\folder1\folder2\prog

Now i have to extract the path of my program ie (C:\folder1\folder2\prog) .I
mean i can split the string using

y=x.split(';')

a=y[-1]

but i dont wanna do this way ,i  wanna search for my program from this list
and then return its path

Please help me on this.

Thanks in advance.


Aditya
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to