Question: Use shutil mode.Create a script called copy_activities.py with a function called stu_activities that does the following: Finds les in ~/Downloads that contain the string Stu_
Use shutil mode.Create a script called copy_activities.py with a function called stu_activities that does the following:
Finds les in ~/Downloads that contain the string Stu_ Copies these les (using the folders naming convention) into the correct Week and Day directory within the CyberSecurity-Notes directory created in part 1.
This question has been posted but does not copy anything to the files
This is what i have already created they need to be copied into these dir
Create a script called create_notes_drs.py . In the le, dene and call a function called main that does the following: Creates a directory called CyberSecurity-Notes in the current working directory Within the CyberSecurity-Notes directory, creates 24 sub-directories (sub-folders), called Week 1 , Week 2 , Week 3 , and so on until up through Week 24 Within each week directory, create 3 sub-directories, called Day 1 , Day 2 , and Day 3
my code for this
import os
def main():
#Storring folder name into a variable
mainDir = "CyberSecurity-Notes"
#isdir will check if the is an existing path
if os.path.isdir(mainDir):
print("Directory already exists")
os.mkdir(mainDir) #creating the dir if it dint find a file name
#This loop will create a folder 24 times
for week in range(1,25):
os.mkdir("{}/Week{}".format(mainDir,week))
#this folder will loop 3 times ceating the days folder before it loops again in the week loop
for day in range(1,4):
os.mkdir("{}/Week{}/Day{}".format(mainDir,week,day))
main()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
