<div dir="ltr">Hello folks,<br><br>I wanna know how can i extract path of a program whose path i have added to the PATH variable.<br><br>This is what i have done<br><br>import os<br><br>x=os.getenv("PATH")<br><br>
print x<br><br>>>%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\QuickTime\QTSystem\;C:\folder1\folder2\prog<br><br>Now i have to extract the path of my program ie (C:\folder1\folder2\prog) .I mean i can split the string using<br>
<br>y=x.split(';')<br><br>a=y[-1]<br><br>but i dont wanna do this way ,i  wanna search for my program from this list and then return its path<br><br>Please help me on this.<br><br>Thanks in advance.<br><br><br>Aditya<br>
</div>