I am trying to create a folder and setting that as the workspace for the rest of the script. However I am not sure why it isn't working.
When I hard wire in a location, the env.workspace can be set to that variable. See script below:
import arcpy, datetime
today = datetime.date.today()
date = today.strftime("%Y%m%d_%B_%Y")
folder = r"path\to\folder\\"
arcpy.env.workspace = folder
However when I create a folder using CreateFolder tool, and set that variable as the env.workspace, I keep getting an error. The script doesn't run.
import arcpy, datetime
today = datetime.date.today()
date = today.strftime("%Y%m%d_%B_%Y")
location = r"path\to\location\\"
folder = arcpy.CreateFolder_management(location, date)
arcpy.env.workspace = folder