diff --git a/.gitignore b/.gitignore index 032492d..ea1472e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -output.html +output/ diff --git a/duree.py b/duree.py index 4a0622d..4476f3c 100644 --- a/duree.py +++ b/duree.py @@ -13,7 +13,7 @@ NOTES: * A limit of 335000 seems to be around the maximum limit that KDP will take """ -import random, phrases +import os, random, phrases class Book(object): """docstring for Book.""" @@ -34,6 +34,9 @@ def generate(self): def gen_volume(self): """generate volume""" + if not os.path.exists("output"): + os.makedirs("output") + print("Created directory: output/") output_file = open("output/vol{0}.html".format(self.volume_num), "w") book = "" real_length = 0