Question: Hello could you please solve the python script for me. I would really appreciate it Lab Assignment:Write a script that will do the following, in
Hello could you please solve the python script for me. I would really appreciate it
Lab Assignment:Write a script that will do the following, in order!:
1.Under your home directory, print to the console, the name of your current directory1PT
2.Under your home directory, create a directory called "Lab3"1PT
3.Change directory to "Lab3"1PT
4.Print to the console the name of the current directory1PT
5.Using a loop, create 10 empty files with the name of "test_
6.Using a loop, create 5 sub-directories with the name of "subdir_
7.List all entries within the "Lab3" directory in the following format:Note: Do not print the "." and ".." directoriesNameType-------------
8.Rename all files that end with .txt to .dat
9.Repeat step 7Write the following methods and use them to solve the problems above: getInodeType: This method takes the name of a file/folder as a parameter and returns a value indicating the inode type (File or Directory). 5PTS
listEntries: Displays the contents of a directory per requirement 7 above. It takes the name of the directory as parameter5PTS
createFiles: Takes the directory name and number of files to create and creates the files per requirement 5 above5PTS
createSubDirectories: Takes the directory name and number of subdirectories to create and creates the subdirectories per requirement 6 5PTS
renameFiles: Uses directory name, current extension of the file, and new extension of files and renames all files based on requirement 8 6PTS
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
