def createFolder():
try:
if not os.path.exists(directory):
os.makedirs(directory)
return 'FolderCreated'
return 'FolderNotCreated'
f = open("/home/raghu/Desktop/raghu1234.txt","a+")
for i in range(10):
f.write("This is the line %d\r\n" % (i+1))
f.close()
# FunctionCall
createFolder()
try:
if not os.path.exists(directory):
os.makedirs(directory)
return 'FolderCreated'
return 'FolderNotCreated'
f = open("/home/raghu/Desktop/raghu1234.txt","a+")
for i in range(10):
f.write("This is the line %d\r\n" % (i+1))
f.close()
# FunctionCall
createFolder()
No comments:
Post a Comment