def which(x):
for p in os.environ.get('<STR_LIT>').split(os.pathsep):<EOL><INDENT>p = os.path.join(p, x)<EOL>if os.path.exists(p):<EOL><INDENT>return os.path.abspath(p)<EOL><DEDENT><DEDENT>return None<EOL>
Same as which command on Linux