Write in Python a script that takes as an input the paths to two text files. If no inputs are provided, the script processes [url removed, login to view] and [url removed, login to view] from its directory.
The two input files are text files, with either Windows or Unix line feed format, saved either as ascii or as UTF-8 w/o BOM.
The script must analyze the input files on line-by-line basis and produce an [url removed, login to view] file to its directory, that contains the analysis results.
All lines that do not contain a backslash character ("\") are to be ignored and not analyzed in any way. All lines are to be analyzed without case sensitivity.
The script is looking for file or directory names in each line. They are in Windows format (i.e. they use a backslash character) and may not contain a drive letter. Each line can contain between 0 and 5 directory names.
The script analyzes the input files in a way it detects which lines of List1 contain directories that are not present in any line of List2, and vice versa.
The directory comparison must work in a way that only the two top elements of the directories are compared against each other and without case sensitivity. In other words, directories "c:\program files\foobar\[url removed, login to view]" and "d:\foobar\[url removed, login to view]" would be considered a match (because top elements \foobar\[url removed, login to view]" == "\foobar\[url removed, login to view]").
If a line contains more than one directory name, for it to be considered a match with any other line in the other list, the other list must contain the same directories.
For sample data [url removed, login to view] and [url removed, login to view], as well as the desired generated [url removed, login to view] for this sample data, please see the attached zip.
The script must be coded for easy readability so it can be understood by people who are not very familiar with Python. Each major step of operations in the source code must be commented to explain what is happening in the script. The script itself does not need to produce any output to screen, except for an error message if no input data is found.