Skip to content

Instantly share code, notes, and snippets.

Created March 10, 2017 03:42
  • Star 57 You must be signed in to star a gist
  • Fork 13 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Create a folder with Python
import os
def createFolder(directory):
if not os.path.exists(directory):
except OSError:
print ('Error: Creating directory. ' + directory)
# Example
# Creates a folder in the current directory called data
Copy link

Thank you, very useful and helped me understand the command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment