<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:tahoma, new york, times, serif;font-size:12pt;color:#000000;"><P>Hi,<BR>I am new to python so my question may be very basic.<BR>Suppose I have a file (sc_1.sh) which the path to that file is in system path:</P>
<P><FONT size=2 face="Courier New, courier, monaco, monospace, sans-serif">SOMETHING=/home/mahmood/scripts</FONT></P>
<P> </P>
<P>Now I want to open that file with respect to the environment variable:<BR><FONT size=2 face="Courier New, courier, monaco, monospace, sans-serif">   import os<BR>   env = os.getenv("SOMETHING")<BR>   print env</FONT></P>
<P><FONT size=2 face="Courier New, courier, monaco, monospace, sans-serif">   infile = open("env/sc_1.sh","r")</FONT></P>
<P> </P>
<P>But here is the error I get:<BR><FONT size=2 face="Courier New, courier, monaco, monospace, sans-serif">/home/mahmood/scripts<BR>Traceback (most recent call last):<BR>  File "test.py", line 7, in <module><BR>    infile = open("env/sc_1.sh","r")<BR>IOError: [Errno 2] No such file or directory: 'env/sc_1.sh'</FONT></P>
<P> </P>
<P>How can I use such variable in open file command?</P>
<P>Thanks,<BR> </P>
<DIV>
<DIV><FONT style="BACKGROUND-COLOR: #ffffff" color=#0080ff size=2 face="arial, helvetica, sans-serif"><STRONG>// Naderan *Mahmood;</STRONG></FONT></DIV></DIV>
<DIV></DIV></div><br>

      </body></html>