File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 1- # Script Name : create_dir_if_not_there.py
2- # Author : Craig Richards
3- # Created : 09th January 2012
4- # Last Modified : 22nd October 2015
5- # Version : 1.0.1
6- # Modifications : Added exceptions
1+ # Script Name : create_dir_if_not_there.py
2+ # Author : Craig Richards
3+ # Created : 09th January 2012
4+ # Last Modified : 22nd October 2015
5+ # Version : 1.0.1
6+ # Modifications : Added exceptions
77# : 1.0.1 Tidy up comments and syntax
88#
9- # Description : Checks to see if a directory exists in the users home directory, if not then create it
9+ # Description : Checks to see if a directory exists in the users home directory, if not then create it
1010
1111import os # Import the OS module
1212try :
13- home = os .path .expanduser ("~" ) # Set the variable home by expanding the users set home directory
14- print home # Print the location
13+ home = os .path .expanduser ("~" ) # Set the variable home by expanding the users set home directory
14+ print home # Print the location
1515
1616 if not os .path .exists (home + '/testdir' ):
17- os .makedirs (home + '/testdir' ) # If not create the directory, inside their home directory
17+ os .makedirs (home + '/testdir' ) # If not create the directory, inside their home directory
1818 except Exceptions as e :
1919 print e
You can’t perform that action at this time.
0 commit comments