Add @sdushantha suggestion in creating directory.

pull/350/head
Christopher K. Hoadley 5 years ago
parent f48a2980f5
commit 1101af8132

@ -620,12 +620,8 @@ def main():
result_file = args.output
elif args.folderoutput:
# The usernames results should be stored in a targeted folder.
# If the folder doesnt exist, create it first
try:
os.mkdir(args.folderoutput)
except FileExistsError:
#directory already exists
pass
# If the folder doesn't exist, create it first
os.makedirs(args.folderoutput, exist_ok=True)
result_file = os.path.join(args.folderoutput, f"{username}.txt")
else:
result_file = f"{username}.txt"

Loading…
Cancel
Save