Created
April 6, 2015 13:37
-
-
Save petfactory/40dec19adc5710857ece to your computer and use it in GitHub Desktop.
Create a dir from datetime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import os | |
time_string = datetime.datetime.now().strftime("%Y-%m-%d %H.%M.%S") | |
#print(time_string) | |
dir_name = 'playblasts {0}'.format(time_string) | |
root_path = r'/Users/johan/Desktop/test' | |
dir_path = os.path.join(root_path, dir_name) | |
#print(dir_path) | |
if not os.path.exists(dir_path): | |
os.makedirs(dir_path) | |
else: | |
print('Exists!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment