Question: In Windows, develop a Python 2.x script, cleanup.py, equivalent to the cleanup Bash script from a previous question. Use standard windows commands or python functions.

In Windows, develop a Python 2.x script, cleanup.py, equivalent to the cleanup Bash script from a previous question. Use standard windows commands or python functions. Your script must delete all backup and auto-save files from the given directory. Assume that names of back up files end in either (i) or (ii) .bak, and (iii) auto-save files have names beginning with a #. Test cleanup.py: (i) create a new directory named TEST in the current directory, create a few files (say 4 each of names chosen by you) that fit the three categories of junk files in TEST, (ii) Use the Windows Cmd program and the Windows DIR command to show the contents of a TEST directory before running your script, (iii) invoke cleanup.py, and again (iv) Use the DIR command to show the contents of the TEST directory after you ran cleanup.py. For your answer, provide the python version you used and copy paste the results of the Windows DIR command showing the contents of a TEST directory before and after running your cleanup.py script. Copy and paste your "cleanup.py" to the answer field for this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
