small script for creating a new directory in python and writing files to it.
#file for creating the db directory
import os
#creates a directory in python
def createdb(directory):
if not os.path.exists(directory):
os.makedirs(directory)
#creates file in a subdirectory, named directory
def write_todb(name, content, directory):
target = open(os.path.join(directory, name), 'w')
target.write(content)
target.close()