Categories
Uncategorized

Make Directory – Python

#!/usr/bin/python
# make Directory

def makeDir():
	import os

	dirName=raw_input("Enter Directory\n>_ ")
	dirPath="downloads/"+dirName

	if not os.path.exists(dirPath):
		os.makedirs(dirPath)
	else:
		print "Already Exists :: Not Created"

makeDir()

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s