Skip to content

Commit 635919a

Browse files
Merge pull request geekcomputers#137 from saanwer/patch-1
Minor Changes Made
2 parents 3091d00 + ea179ed commit 635919a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

dir_test.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77

88
# Description : Tests to see if the directory testdir exists, if not it will create the directory for you
99

10-
import os # Import the OS module
11-
DirCheck = raw_input("Please enter directory name to check : ")
10+
import os #Import the OS Module
11+
CheckDir = raw_input("Enter the name of the directory to check : ")
1212
print
13-
print "There was no directory under the name " +DirCheck
14-
print
15-
print "So, a new directory under the name " +DirCheck + " has been created!"
16-
if not os.path.exists(DirCheck): # Check to see if it exists
17-
os.makedirs(DirCheck) # Create the directory
13+
if os.path.exists(CheckDir):#Checks if the dir exists
14+
print "The directory exists"
15+
else:
16+
print "No directory found for "+CheckDir #Output if no directory
17+
print
18+
os.makedirs(CheckDir)#Creates a new dir for the given name
19+
print "Directory created for "+CheckDir

0 commit comments

Comments
 (0)