Import pathlib and shutil modules Create a path object that…
Question Import pathlib and shutil modules Create a path object that… Import pathlib and shutil modulesCreate a path object that represents your current working directoryPrint out your current directory’s pathReferencing the current working directory path object, create a new path object that will be used to create a new folder. The new folder is to be called “folder_week11”.Create a new directory using the path created in the prior step.Using the path that was created to make the “folder_week11” directory, create a path that will be used to create text file. The name of the test file will be “week11.txt”Use the method to create the “week11.txt” file as a blank file.Create a string variable that will be used to write the following text to the “week_11.txt” text file: “Test: Writing to file.”Print out the the file contents (using the read() method) to confirm that text was written.Make a new path in the folder_week11 directory and call it “file_backups”Make a new directory referencing the new path created in the prior step.Using the shutil module, make copy of the week11.txt file, called “week11_backup.txt” and save it in the file_backups directory.Navigate back to the folder_week11 directoryFrom the folder_week11 directory, use rglob() method to print out only the txt files that have been created in this directory and the subdirectories. There should only be two files. Computer Science Engineering & Technology Python Programming 547 202 Share QuestionEmailCopy link Comments (0)


