How can I modify this to create a subdirectory with unique value name and then write the shapefile to it?
#unique value
You can create new directories with the os module mkdir function. I would recommend using that along with os.path.join to write the output file name for your shapefile
os.mkdir()
https://docs.python.org/2/library/os.html#os.mkdir
os.path.join()
https://docs.python.org/2/library/os.path.html#os.path.isfile
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.