Question: please write the code with Python The shell environment variable $PATH contains a delimiter-separated sequence of directory paths (the delimiter varies between platforms). The shell
please write the code with Python 
The shell environment variable $PATH contains a delimiter-separated sequence of directory paths (the delimiter varies between platforms). The shell uses the content of this variable to determine where to look for executables that correspond to commands entered at the command line. You can view this on Linux using the command: echo $PATH (using Windows CMD it's: echo $PATH?). Write a function named decompose_path() that takes a single string argument, named path. path will contain the contents of the PATH environment variable as returned by the echo $PATH command. Use a regular expression to create a list of each directory in PATH. The function should return that list. For example: path = "/usr/openwin/bin:/usr/ucb:/usr/bin:/bin:/etc:/usr/local/bin:/us r/local/lib:/usr/shareware/bin:/usr/shareware/lib: ." returns = ["/usr/openwin/bin", /usr/ucb", "/usr/bin", "/bin", "/etc", "/usr/local/bin", "/usr/local/lib", "/usr/shareware/bin", "/usr/shareware/lib", "."]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
