Jan-20-2024, 06:51 PM
Hello Team,
Below script creates a folder based from a previous date,
My question is,
1. How to declare the if/ else statement that says print("Folder created") else print("Folder already exists")
2. How to create folder in different drives
Below script creates a folder based from a previous date,
My question is,
1. How to declare the if/ else statement that says print("Folder created") else print("Folder already exists")
2. How to create folder in different drives
path = "c:\user\user\My Documents" path1 = "d:\user\user\backup" >>> current_time = yesterday.strftime('%Y\%b_%Y\%Y-%m-%d') >>> print(current_time) 2024\Jan_2024\2024-01-20 >>> command = "mkdir {0}".format(current_time) >>> print(command) mkdir 2024\Jan_2024\2024-01-20