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
1 2 3 4 5 6 7 8 9 |
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 |
Larz60+ write Jan-21-2024, 11:41 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Modified for you this time. Please use BBCode tags on future posts
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Modified for you this time. Please use BBCode tags on future posts