Skip to content

Commit 2d58138

Browse files
committed
Test to see if a directory exists, if not create it
0 parents  commit 2d58138

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

dir_test.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Script Name : dir_test.py
2+
# Author : Craig Richards
3+
# Created : 29th November 2011
4+
# Version : 1.0
5+
6+
# Modifications :
7+
# Description : Tests to see if the directory testdir exists, if not it will create the directory for you
8+
9+
import os # Import the OS module
10+
11+
if not os.path.exists('testdir'): # Check to see if it exists
12+
os.makedirs('testdir') # Create the directory

0 commit comments

Comments
 (0)